Ejemplo n.º 1
0
def test_bug_branch(mocker, bug_fixture_prefetch, alias, version):
    """Test that branch matches alias of current version"""
    mocker.patch("bugmon.bug.Fetcher.resolve_esr",
                 side_effect=["esr78", "esr68"])
    bug = EnhancedBug(bugsy=None, **bug_fixture_prefetch)

    # Set fixed central version and bug version
    bug._central_version = 81
    bug._bug["version"] = version

    assert bug.branch == alias
Ejemplo n.º 2
0
def test_bug_branches(mocker, bug_fixture_prefetch):
    """Test branch enumeration"""
    mocker.patch("bugmon.bug.Fetcher.resolve_esr",
                 side_effect=["esr78", "esr68"])
    bug = EnhancedBug(bugsy=None, **bug_fixture_prefetch)
    # Set fixed central version
    bug._central_version = 81

    for alias, version in bug.branches.items():
        if alias == "central":
            assert version == 81
        elif alias == "beta":
            assert version == 80
        elif alias == "release":
            assert version == 79
        elif alias == "esr78":
            assert version == 78
        elif alias == "esr68":
            assert version == 68