File: test_or_later_operator.py

package info (click to toggle)
python-spdx-tools 0.8.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,024 kB
  • sloc: python: 18,708; xml: 12,553; sh: 46; makefile: 6
file content (22 lines) | stat: -rw-r--r-- 632 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# SPDX-FileCopyrightText: 2023 spdx contributors
#
# SPDX-License-Identifier: Apache-2.0
import pytest

from spdx_tools.spdx3.model.licensing import ListedLicense, OrLaterOperator
from tests.spdx3.fixtures import fixture_factory


def test_valid_initialization():
    lic = fixture_factory(ListedLicense)
    or_later_operator = OrLaterOperator(lic)

    assert or_later_operator.subject_license == lic


def test_invalid_initialization():
    with pytest.raises(TypeError) as err:
        OrLaterOperator("License")

    assert len(err.value.args[0]) == 1
    assert err.value.args[0][0].startswith("SetterError OrLaterOperator:")