Skip to content
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

also use the src-layout for tests #419

Merged
merged 1 commit into from
Jan 17, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/install_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
- name: Run tests
run: pytest
- name: Run CLI
run: pyspdxtools -i ./tests/data/formats/SPDXJSONExample-v2.3.spdx.json
run: pyspdxtools -i ./tests/spdx/data/formats/SPDXJSONExample-v2.3.spdx.json
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from spdx.model.actor import Actor, ActorType
from spdx.model.document import CreationInfo
from spdx.model.version import Version
from tests.fixtures import creation_info_fixture
from tests.spdx.fixtures import creation_info_fixture


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
from spdx.model.document import Document
from spdx.model.extracted_licensing_info import ExtractedLicensingInfo
from spdx.model.relationship import Relationship, RelationshipType
from tests.fixtures import creation_info_fixture, file_fixture, package_fixture, external_document_ref_fixture, \
from tests.spdx.fixtures import creation_info_fixture, file_fixture, package_fixture, external_document_ref_fixture, \
snippet_fixture, annotation_fixture, document_fixture, relationship_fixture
from tests.mock_utils import assert_mock_method_called_with_arguments, assert_no_mock_methods_called
from tests.spdx.mock_utils import assert_mock_method_called_with_arguments, assert_no_mock_methods_called


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from spdx.jsonschema.extracted_licensing_info_properties import ExtractedLicensingInfoProperty
from spdx.model.extracted_licensing_info import ExtractedLicensingInfo
from spdx.model.spdx_no_assertion import SpdxNoAssertion, SPDX_NO_ASSERTION_STRING
from tests.fixtures import extracted_licensing_info_fixture
from tests.spdx.fixtures import extracted_licensing_info_fixture


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
from spdx.model.license_expression import LicenseExpression
from spdx.model.spdx_no_assertion import SpdxNoAssertion, SPDX_NO_ASSERTION_STRING
from spdx.model.spdx_none import SpdxNone, SPDX_NONE_STRING
from tests.fixtures import creation_info_fixture, file_fixture, annotation_fixture, document_fixture
from tests.mock_utils import assert_mock_method_called_with_arguments
from tests.spdx.fixtures import creation_info_fixture, file_fixture, annotation_fixture, document_fixture
from tests.spdx.mock_utils import assert_mock_method_called_with_arguments


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
from spdx.model.relationship import RelationshipType
from spdx.model.spdx_no_assertion import SpdxNoAssertion, SPDX_NO_ASSERTION_STRING
from spdx.model.spdx_none import SpdxNone, SPDX_NONE_STRING
from tests.fixtures import creation_info_fixture, package_fixture, external_package_ref_fixture, document_fixture, \
from tests.spdx.fixtures import creation_info_fixture, package_fixture, external_package_ref_fixture, document_fixture, \
annotation_fixture, file_fixture, relationship_fixture, snippet_fixture
from tests.mock_utils import assert_mock_method_called_with_arguments
from tests.spdx.mock_utils import assert_mock_method_called_with_arguments


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from spdx.model.relationship import Relationship, RelationshipType
from spdx.model.spdx_no_assertion import SpdxNoAssertion, SPDX_NO_ASSERTION_STRING
from spdx.model.spdx_none import SpdxNone, SPDX_NONE_STRING
from tests.fixtures import relationship_fixture
from tests.spdx.fixtures import relationship_fixture


@pytest.fixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from spdx.model.snippet import Snippet
from spdx.model.spdx_no_assertion import SpdxNoAssertion, SPDX_NO_ASSERTION_STRING
from spdx.model.spdx_none import SpdxNone, SPDX_NONE_STRING
from tests.fixtures import creation_info_fixture, snippet_fixture, document_fixture, annotation_fixture
from tests.mock_utils import assert_mock_method_called_with_arguments
from tests.spdx.fixtures import creation_info_fixture, snippet_fixture, document_fixture, annotation_fixture
from tests.spdx.mock_utils import assert_mock_method_called_with_arguments


@pytest.fixture
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from spdx.model.actor import ActorType
from spdx.validation.actor_validator import validate_actor
from spdx.validation.validation_message import ValidationMessage, ValidationContext, SpdxElementType
from tests.fixtures import actor_fixture
from tests.spdx.fixtures import actor_fixture


def test_valid_actor_person():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from spdx.model.document import Document
from spdx.validation.annotation_validator import validate_annotation
from spdx.validation.validation_message import ValidationMessage, ValidationContext, SpdxElementType
from tests.fixtures import document_fixture, annotation_fixture, file_fixture
from tests.spdx.fixtures import document_fixture, annotation_fixture, file_fixture


def test_valid_annotation():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from spdx.model.checksum import Checksum, ChecksumAlgorithm
from spdx.validation.checksum_validator import validate_checksum
from spdx.validation.validation_message import ValidationMessage, ValidationContext, SpdxElementType
from tests.fixtures import checksum_fixture
from tests.spdx.fixtures import checksum_fixture


@pytest.mark.parametrize("checksum",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from spdx.validation.creation_info_validator import validate_creation_info
from spdx.validation.validation_message import ValidationMessage, ValidationContext, SpdxElementType
from tests.fixtures import creation_info_fixture
from tests.spdx.fixtures import creation_info_fixture


def test_valid_creation_info():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from spdx.model.document import Document, CreationInfo
from spdx.validation.document_validator import validate_full_spdx_document
from spdx.validation.validation_message import ValidationMessage, ValidationContext, SpdxElementType
from tests.fixtures import document_fixture, creation_info_fixture
from tests.spdx.fixtures import document_fixture, creation_info_fixture


def test_valid_document():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from spdx.validation.external_document_ref_validator import validate_external_document_ref
from spdx.validation.validation_message import ValidationMessage
from tests.fixtures import external_document_ref_fixture
from tests.spdx.fixtures import external_document_ref_fixture


def test_valid_external_document_ref():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from spdx.validation.external_package_ref_validator import validate_external_package_ref
from spdx.validation.validation_message import ValidationMessage, ValidationContext, SpdxElementType
from tests.fixtures import external_package_ref_fixture
from tests.spdx.fixtures import external_package_ref_fixture


def test_valid_external_package_ref():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from spdx.validation.extracted_licensing_info_validator import validate_extracted_licensing_info
from spdx.validation.validation_message import ValidationMessage, ValidationContext, SpdxElementType
from tests.fixtures import extracted_licensing_info_fixture
from tests.spdx.fixtures import extracted_licensing_info_fixture


def test_valid_extracted_licensing_info():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from spdx.model.checksum import Checksum, ChecksumAlgorithm
from spdx.validation.file_validator import validate_file_within_document
from spdx.validation.validation_message import ValidationMessage, ValidationContext, SpdxElementType
from tests.fixtures import file_fixture, document_fixture
from tests.spdx.fixtures import file_fixture, document_fixture


def test_valid_file():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from spdx.model.spdx_none import SpdxNone
from spdx.validation.package_validator import validate_package_within_document
from spdx.validation.validation_message import ValidationMessage, ValidationContext, SpdxElementType
from tests.fixtures import package_fixture, package_verification_code_fixture, document_fixture
from tests.spdx.fixtures import package_fixture, package_verification_code_fixture, document_fixture


def test_valid_package():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from spdx.model.spdx_none import SpdxNone
from spdx.validation.relationship_validator import validate_relationship
from spdx.validation.validation_message import ValidationMessage, SpdxElementType, ValidationContext
from tests.fixtures import document_fixture, relationship_fixture
from tests.spdx.fixtures import document_fixture, relationship_fixture


@pytest.mark.parametrize("related_spdx_element",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from spdx.validation.snippet_validator import validate_snippet_within_document
from spdx.validation.validation_message import ValidationMessage, ValidationContext, SpdxElementType
from tests.fixtures import document_fixture, snippet_fixture
from tests.spdx.fixtures import document_fixture, snippet_fixture


def test_valid_snippet():
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import pytest

from spdx.writer.json.json_writer import write_document
from tests.fixtures import document_fixture
from tests.spdx.fixtures import document_fixture


@pytest.fixture
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# limitations under the License.
from unittest.mock import patch, mock_open, call

from tests.fixtures import package_fixture
from tests.spdx.fixtures import package_fixture
from spdx.writer.tagvalue.package_writer import write_package


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import pytest

from tests.fixtures import document_fixture
from tests.spdx.fixtures import document_fixture
from spdx.writer.tagvalue.tagvalue_writer import write_document_to_file


Expand Down