File: test_bump_utils.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 (25 lines) | stat: -rw-r--r-- 845 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
23
24
25
# SPDX-FileCopyrightText: 2022 spdx contributors

# SPDX-License-Identifier: Apache-2.0
import pytest

from spdx_tools.spdx3.bump_from_spdx2.bump_utils import handle_no_assertion_or_none
from spdx_tools.spdx.model.spdx_no_assertion import SpdxNoAssertion
from spdx_tools.spdx.model.spdx_none import SpdxNone


@pytest.mark.parametrize(
    "input_argument,expected_value,expected_stdout",
    [
        (SpdxNone(), None, "test_field: Missing conversion for SpdxNone.\n"),
        (SpdxNoAssertion(), None, ""),
        ("test_string", "test_string", ""),
    ],
)
def test_handle_no_assertion_or_none(input_argument, expected_value, expected_stdout, capsys):
    value = handle_no_assertion_or_none(input_argument, "test_field")

    captured = capsys.readouterr()

    assert value == expected_value
    assert captured.out == expected_stdout