Skip to content

[fix] remove leftover legacy files. Add NOASSERTION as possible value… #370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/model/extracted_licensing_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from dataclasses import field
from typing import Optional, List
from typing import Optional, List, Union

from src.model.spdx_no_assertion import SpdxNoAssertion
from src.model.typing.dataclass_with_properties import dataclass_with_properties
from src.model.typing.type_checks import check_types_and_set_values

Expand All @@ -19,12 +20,12 @@
class ExtractedLicensingInfo:
license_id: Optional[str] = None
extracted_text: Optional[str] = None
license_name: Optional[str] = None
license_name: Optional[Union[str, SpdxNoAssertion]] = None
cross_references: List[str] = field(default_factory=list)
comment: Optional[str] = None

def __init__(self, license_id: Optional[str] = None, extracted_text: Optional[str] = None,
license_name: Optional[str] = None, cross_references: List[str] = None,
license_name: Optional[Union[str, SpdxNoAssertion]] = None, cross_references: List[str] = None,
comment: Optional[str] = None):
cross_references = [] if cross_references is None else cross_references
check_types_and_set_values(self, locals())
8 changes: 4 additions & 4 deletions tests/clitools/test_cli_convertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
from unittest import TestCase

import pytest

from src.clitools.convertor import determine_infile_and_outfile
from tests.testing_utils import raises


class TestConvertor(TestCase):
Expand Down Expand Up @@ -71,12 +71,12 @@ def test_determine_input_with_unknown_i_format_known_o_format(self):
assert infile == expected_infile
assert outfile == outfile_given

@raises(ValueError)
def test_determine_input_with_invalid_arguments(self):
infile_given = None
outfile_given = None
src = ()
from_ = None
to = None

infile, outfile = determine_infile_and_outfile(infile_given, outfile_given, src, from_, to)
with pytest.raises(ValueError):
determine_infile_and_outfile(infile_given, outfile_given, src, from_, to)
74 changes: 0 additions & 74 deletions tests/test_checksum.py

This file was deleted.

Loading