Skip to content

Add new copyright test cases #2299

@pombredanne

Description

@pombredanne

See https://github.com/oss-review-toolkit/ort/blob/9493dab0cad7e102509a4a061e7bb87dd69ef598/utils/src/test/assets/copyright-statements-expected-output.yml

These are potentially incorrect copyright detection in ScanCode Toolkit.

First is to understand how the copyright tests work by carefully reading and trying to follow execution of https://github.com/nexB/scancode-toolkit/blob/develop/tests/cluecode/test_copyrights.py

We generate test method at import time that are attached to a test class (See https://github.com/nexB/scancode-toolkit/blob/develop/tests/cluecode/cluecode_test_utils.py for the generation code) and in particular see https://github.com/nexB/scancode-toolkit/blob/develop/tests/cluecode/cluecode_test_utils.py#L55 for details on how test files are organized: a file to test for copyrights and a YAML file with expected results such as here: https://github.com/nexB/scancode-toolkit/tree/develop/tests/cluecode/data/copyrights

So the approach would likely be to generate these tests file pairs such as these:

You can run the test suite with pytest -vvs --test-suite=all tests/cluecode/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions