Exemplo n.º 1
0
def test_firefox_version_constructor_minimum_kwargs():
    assert str(FirefoxVersion(32, 0)) == '32.0'
    assert str(FirefoxVersion(32, 0, 1)) == '32.0.1'
    assert str(FirefoxVersion(32, 1, 0)) == '32.1.0'
    assert str(FirefoxVersion(32, 0, 1, 1)) == '32.0.1build1'
    assert str(FirefoxVersion(32, 0, beta_number=1)) == '32.0b1'
    assert str(FirefoxVersion(32, 0, is_nightly=True)) == '32.0a1'
    assert str(FirefoxVersion(32, 0, is_aurora_or_devedition=True)) == '32.0a2'
    assert str(FirefoxVersion(32, 0, is_esr=True)) == '32.0esr'
    assert str(FirefoxVersion(32, 0, 1, is_esr=True)) == '32.0.1esr'
Exemplo n.º 2
0
def test_firefox_version_constructor_and_str(major_number, minor_number,
                                             patch_number, beta_number,
                                             build_number, is_nightly,
                                             is_aurora_or_devedition, is_esr,
                                             expected_output_string):
    assert str(
        FirefoxVersion(major_number=major_number,
                       minor_number=minor_number,
                       patch_number=patch_number,
                       beta_number=beta_number,
                       build_number=build_number,
                       is_nightly=is_nightly,
                       is_aurora_or_devedition=is_aurora_or_devedition,
                       is_esr=is_esr)) == expected_output_string
Exemplo n.º 3
0
def test_fail_firefox_version_constructor(major_number, minor_number,
                                          patch_number, beta_number,
                                          build_number, is_nightly,
                                          is_aurora_or_devedition, is_esr,
                                          ExpectedErrorType):
    with pytest.raises(ExpectedErrorType):
        FirefoxVersion(major_number=major_number,
                       minor_number=minor_number,
                       patch_number=patch_number,
                       beta_number=beta_number,
                       build_number=build_number,
                       is_nightly=is_nightly,
                       is_aurora_or_devedition=is_aurora_or_devedition,
                       is_esr=is_esr)
Exemplo n.º 4
0
def test_balrog_release_name_constructor_and_str(
        product, major_number, minor_number, patch_number, beta_number,
        build_number, is_nightly, is_aurora_or_devedition, is_esr,
        expected_output_string):
    assert str(
        BalrogReleaseName(
            product,
            FirefoxVersion(major_number=major_number,
                           minor_number=minor_number,
                           patch_number=patch_number,
                           build_number=build_number,
                           beta_number=beta_number,
                           is_nightly=is_nightly,
                           is_aurora_or_devedition=is_aurora_or_devedition,
                           is_esr=is_esr))) == expected_output_string
Exemplo n.º 5
0
def test_fail_balrog_release_constructor(product, major_number, minor_number,
                                         patch_number, beta_number,
                                         build_number, is_nightly,
                                         is_aurora_or_devedition, is_esr,
                                         ExpectedErrorType):
    with pytest.raises(ExpectedErrorType):
        BalrogReleaseName(
            product,
            FirefoxVersion(major_number=major_number,
                           minor_number=minor_number,
                           patch_number=patch_number,
                           beta_number=beta_number,
                           build_number=build_number,
                           is_nightly=is_nightly,
                           is_aurora_or_devedition=is_aurora_or_devedition,
                           is_esr=is_esr))
Exemplo n.º 6
0
from shipit_api.admin.api import get_signoff_emails
from shipit_api.admin.release import bump_version, is_eme_free_enabled, is_partner_enabled, is_rc, parse_version
from shipit_api.common.models import XPISignoff
from shipit_api.common.product import Product


@pytest.mark.parametrize(
    "product, version, expectation, result",
    (
        ("devedition", "56.0b1", does_not_raise(),
         DeveditionVersion(56, 0, beta_number=1)),
        (Product.DEVEDITION, "56.0b1", does_not_raise(),
         DeveditionVersion(56, 0, beta_number=1)),
        ("pinebuild", "56.0b1", does_not_raise(),
         FirefoxVersion(56, 0, beta_number=1)),
        (Product.PINEBUILD, "56.0b1", does_not_raise(),
         FirefoxVersion(56, 0, beta_number=1)),
        ("fenix", "84.0.0-beta.2", does_not_raise(),
         FenixVersion(84, 0, 0, beta_number=2)),
        (Product.FENIX, "84.0.0", does_not_raise(), FenixVersion(84, 0, 0)),
        ("fennec", "68.2b3", does_not_raise(),
         FennecVersion(68, 2, beta_number=3)),
        (Product.FENNEC, "68.2b3", does_not_raise(),
         FennecVersion(68, 2, beta_number=3)),
        ("firefox", "45.0", does_not_raise(), FirefoxVersion(45, 0)),
        (Product.FIREFOX, "45.0", does_not_raise(), FirefoxVersion(45, 0)),
        ("thunderbird", "60.8.0", does_not_raise(), ThunderbirdVersion(
            60, 8, 0)),
        (Product.THUNDERBIRD, "60.8.0", does_not_raise(),
         ThunderbirdVersion(60, 8, 0)),
Exemplo n.º 7
0
from shipit_api.admin.api import get_signoff_emails
from shipit_api.admin.release import bump_version, is_eme_free_enabled, is_partner_enabled, is_rc, parse_version
from shipit_api.common.models import XPISignoff
from shipit_api.common.product import Product


@pytest.mark.parametrize(
    "product, version, expectation, result",
    (
        ("devedition", "56.0b1", does_not_raise(), DeveditionVersion(56, 0, beta_number=1)),
        (Product.DEVEDITION, "56.0b1", does_not_raise(), DeveditionVersion(56, 0, beta_number=1)),
        ("fenix", "84.0.0-beta.2", does_not_raise(), FenixVersion(84, 0, 0, beta_number=2)),
        (Product.FENIX, "84.0.0", does_not_raise(), FenixVersion(84, 0, 0)),
        ("fennec", "68.2b3", does_not_raise(), FennecVersion(68, 2, beta_number=3)),
        (Product.FENNEC, "68.2b3", does_not_raise(), FennecVersion(68, 2, beta_number=3)),
        ("firefox", "45.0", does_not_raise(), FirefoxVersion(45, 0)),
        (Product.FIREFOX, "45.0", does_not_raise(), FirefoxVersion(45, 0)),
        ("thunderbird", "60.8.0", does_not_raise(), ThunderbirdVersion(60, 8, 0)),
        (Product.THUNDERBIRD, "60.8.0", does_not_raise(), ThunderbirdVersion(60, 8, 0)),
        ("non-existing-product", "68.0", pytest.raises(ValueError), None),
        # fennec_release used to be a valid value when we moved Fennec to ESR68
        # https://github.com/mozilla/release-services/pull/2265
        # Let's be explicitly failing about it.
        ("fennec_release", "68.1.1", pytest.raises(ValueError), None),
    ),
)
def test_parse_version(product, version, expectation, result):
    with expectation:
        assert parse_version(product, version) == result

Exemplo n.º 8
0
from shipit_api.release import is_eme_free_enabled
from shipit_api.release import is_partner_enabled
from shipit_api.release import is_rc
from shipit_api.release import parse_version


@pytest.mark.parametrize('product, version, expectation, result', (
    ('devedition', '56.0b1', does_not_raise(),
     DeveditionVersion(56, 0, beta_number=1)),
    (Product.DEVEDITION, '56.0b1', does_not_raise(),
     DeveditionVersion(56, 0, beta_number=1)),
    ('fennec', '68.2b3', does_not_raise(), FennecVersion(68, 2,
                                                         beta_number=3)),
    (Product.FENNEC, '68.2b3', does_not_raise(),
     FennecVersion(68, 2, beta_number=3)),
    ('firefox', '45.0', does_not_raise(), FirefoxVersion(45, 0)),
    (Product.FIREFOX, '45.0', does_not_raise(), FirefoxVersion(45, 0)),
    ('thunderbird', '60.8.0', does_not_raise(), ThunderbirdVersion(60, 8, 0)),
    (Product.THUNDERBIRD, '60.8.0', does_not_raise(),
     ThunderbirdVersion(60, 8, 0)),
    ('non-existing-product', '68.0', pytest.raises(ValueError), None),
))
def test_parse_version(product, version, expectation, result):
    with expectation:
        assert parse_version(product, version) == result


@pytest.mark.parametrize('product, version, partial_updates, result', (
    ('firefox', '57.0', {
        '56.0b1': [],
        '55.0': []