Browse Source

Add a test

uncommentable2
carmenbianca 2 weeks ago
parent
commit
c7e5e578d0
Signed by: Carmen Bianca Bakker <carmenbianca@fsfe.org> GPG Key ID: 76EBA6F6B6EA2EC9
1 changed files with 16 additions and 1 deletions
  1. 16
    1
      tests/test_report.py

+ 16
- 1
tests/test_report.py View File

@@ -88,12 +88,27 @@ def test_generate_project_report_simple(fake_repository):
project = Project(fake_repository)
result = ProjectReport.generate(project)

assert not result.missing_licenses
assert not result.bad_licenses
assert not result.licenses_without_extension
assert not result.missing_licenses
assert not result.unused_licenses
assert result.used_licenses
assert not result.read_errors
assert result.file_reports


def test_generate_project_report_licenses_without_extension(fake_repository):
"""Licenses without extension are detected."""
(fake_repository / "LICENSES/CC0-1.0.txt").rename(
fake_repository / "LICENSES/CC0-1.0"
)

project = Project(fake_repository)
result = ProjectReport.generate(project)

assert "CC0-1.0" in result.licenses_without_extension


def test_generate_project_report_missing_license(fake_repository):
"""Missing licenses are detected."""
(fake_repository / "LICENSES/GPL-3.0-or-later.txt").unlink()

Loading…
Cancel
Save