Ejemplo n.º 1
0
def test_balrog_release_implements_remaining_comparision_operators():
    assert BalrogReleaseName.parse(
        'firefox-32.0-build1') == BalrogReleaseName.parse(
            'firefox-32.0-build1')
    assert BalrogReleaseName.parse(
        'firefox-32.0-build1') != BalrogReleaseName.parse(
            'firefox-33.0-build1')

    assert BalrogReleaseName.parse(
        'firefox-32.0-build1') <= BalrogReleaseName.parse(
            'firefox-32.0-build1')
    assert BalrogReleaseName.parse(
        'firefox-32.0-build1') <= BalrogReleaseName.parse(
            'firefox-33.0-build1')

    assert BalrogReleaseName.parse(
        'firefox-33.0-build1') >= BalrogReleaseName.parse(
            'firefox-32.0-build1')
    assert BalrogReleaseName.parse(
        'firefox-33.0-build1') >= BalrogReleaseName.parse(
            'firefox-33.0-build1')

    assert BalrogReleaseName.parse(
        'firefox-33.0-build1') > BalrogReleaseName.parse('firefox-32.0-build1')
    assert not BalrogReleaseName.parse(
        'firefox-33.0-build1') > BalrogReleaseName.parse('firefox-33.0-build1')

    assert not BalrogReleaseName.parse(
        'firefox-32.0-build1') < BalrogReleaseName.parse('firefox-32.0-build1')

    assert BalrogReleaseName.parse(
        'firefox-33.0-build1') != BalrogReleaseName.parse(
            'firefox-32.0-build1')
Ejemplo n.º 2
0
def test_fail_balrog_release_lt_operator():
    with pytest.raises(ValueError):
        assert BalrogReleaseName.parse(
            'thunderbird-32.0-build1') < BalrogReleaseName.parse(
                'Firefox-32.0-build2')
Ejemplo n.º 3
0
def test_firefox_version_raises_when_invalid_version_is_given(
        string, ExpectedErrorType):
    with pytest.raises(ExpectedErrorType):
        BalrogReleaseName.parse(string)
Ejemplo n.º 4
0
def test_balrog_release_implements_lt_operator(previous, next):
    assert BalrogReleaseName.parse(previous) < BalrogReleaseName.parse(next)
Ejemplo n.º 5
0
def test_balrog_release_name_parse(string, expected_string):
    assert str(BalrogReleaseName.parse(string)) == expected_string