Beispiel #1
0
def test_check_repository(repository, fake_path):
    checks = [check_passing, check_found, check_unknown]

    results = uut.check_repository(checks, repository, fake_path)

    assert list(results) == [
        uut.Result("check:passing", False, {"ignore": "details"}),
        uut.Result(
            "check:found",
            True,
            {
                "context_name": repository.name,
                "context_owner": repository.owner,
                "context_path": str(fake_path),
            },
        ),
    ]
Beispiel #2
0
def test_check_context__result_with_details(check_context):
    result = check_context.Result("games:doom", True, {"cheat": "IDDQD"})
    assert result == uut.Result("games:doom", True, {"cheat": "IDDQD"})
Beispiel #3
0

pytestmark = pytest.mark.django_db


def test_check_context__init(repository, fake_path):
    context = uut.CheckContext(repository, fake_path)
    assert context.owner == repository.owner
    assert context.name == repository.name
    assert context.path == fake_path


@pytest.mark.parametrize(
    "issue_key, is_found, result",
    (
        ("missing:food", True, uut.Result("missing:food", True, None)),
        ("missing:coffee", False, uut.Result("missing:coffee", False, None)),
    ),
)
def test_check_context__result(issue_key, is_found, result, check_context):
    assert result == check_context.Result(issue_key, is_found)


def test_check_context__result_with_details(check_context):
    result = check_context.Result("games:doom", True, {"cheat": "IDDQD"})
    assert result == uut.Result("games:doom", True, {"cheat": "IDDQD"})


@pytest.mark.parametrize(
    "is_found, status",
    ((True, Issue.Status.NEW.value), (False, Issue.Status.NOT_FOUND.value)),