def test_fail_gecko_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): GeckoVersion(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)
def test_gecko_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( GeckoVersion(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
def test_gecko_version_constructor_minimum_kwargs(): assert str(GeckoVersion(31, 0, is_esr=True)) == '31.0esr' assert str(GeckoVersion(31, 0, 1, is_esr=True)) == '31.0.1esr' assert str(GeckoVersion(32, 0)) == '32.0' assert str(GeckoVersion(32, 0, 1)) == '32.0.1' assert str(GeckoVersion(32, 1, 0)) == '32.1.0' assert str(GeckoVersion(32, 0, 1, 1)) == '32.0.1build1' assert str(GeckoVersion(32, 0, beta_number=1)) == '32.0b1' assert str(GeckoVersion(32, 0, is_nightly=True)) == '32.0a1' assert str(GeckoVersion(32, 0, is_aurora_or_devedition=True)) == '32.0a2' assert str(GeckoVersion(1, 0, release_candidate_number=1)) == '1.0rc1' assert str(GeckoVersion(1, 5, 0, old_fourth_number=1)) == '1.5.0.1'