mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-25 23:28:18 +01:00
tests/test_check.py: Add tests for licenses
This commit is contained in:
parent
3b17914002
commit
5318953150
@ -336,3 +336,27 @@ def test_check_correct_iso_639_3_language():
|
|||||||
result = experimental.correct_language(series)
|
result = experimental.correct_language(series)
|
||||||
|
|
||||||
assert result == language
|
assert result == language
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_valid_spdx_license_identifier():
|
||||||
|
"""Test valid SPDX license identifier."""
|
||||||
|
|
||||||
|
license = "CC-BY-SA-4.0"
|
||||||
|
|
||||||
|
result = check.spdx_license_identifier(license)
|
||||||
|
|
||||||
|
assert result == license
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_invalid_spdx_license_identifier(capsys):
|
||||||
|
"""Test invalid SPDX license identifier."""
|
||||||
|
|
||||||
|
license = "CC-BY-SA"
|
||||||
|
|
||||||
|
result = check.spdx_license_identifier(license)
|
||||||
|
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert (
|
||||||
|
captured.out
|
||||||
|
== f"{Fore.YELLOW}Non-SPDX license identifier: {Fore.RESET}{license}\n"
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user