def test_valid_beta_tags(self): tag = tag_of_beta('57.0b9') self.assertEqual(tag, "FIREFOX_57_0b9_RELEASE") tag = tag_of_beta('60.0b12') self.assertEqual(tag, "FIREFOX_60_0b12_RELEASE") tag = tag_of_beta('65') self.assertEqual(tag, "FIREFOX_RELEASE_65_BASE") tag = tag_of_beta('66.0') self.assertEqual(tag, "FIREFOX_RELEASE_66_BASE")
def test_valid_beta_tags(self): tag = tag_of_beta('57.0b9') self.assertEquals(tag, "FIREFOX_57_0b9_RELEASE") tag = tag_of_beta('60.0b12') self.assertEquals(tag, "FIREFOX_60_0b12_RELEASE") tag = tag_of_beta('65') self.assertEquals(tag, "FIREFOX_RELEASE_65_BASE") tag = tag_of_beta('66.0') self.assertEquals(tag, "FIREFOX_RELEASE_66_BASE")
def test_valid_beta_tags(self): tag = tag_of_beta("57.0b9") self.assertEqual(tag, "FIREFOX_57_0b9_RELEASE") tag = tag_of_beta("60.0b12") self.assertEqual(tag, "FIREFOX_60_0b12_RELEASE") tag = tag_of_beta("65") self.assertEqual(tag, "FIREFOX_RELEASE_65_BASE") tag = tag_of_beta("66.0") self.assertEqual(tag, "FIREFOX_RELEASE_66_BASE")
def _convert_to_bisect_arg(self, value): """ Transform a string value to a date or datetime if it looks like it. """ try: value = parse_date(value) except DateFormatError: try: repo = self.options.repo if (get_name(repo) == 'mozilla-release' or (not repo and re.match(r'^\d+\.\d\.\d$', value))): new_value = tag_of_release(value) if not repo: self.logger.info("Assuming repo mozilla-release") self.fetch_config.set_repo('mozilla-release') self.logger.info("Using tag %s for release %s" % (new_value, value)) value = new_value elif (get_name(repo) == 'mozilla-beta' or (not repo and re.match(r'^\d+\.0b\d+$', value))): new_value = tag_of_beta(value) if not repo: self.logger.info("Assuming repo mozilla-beta") self.fetch_config.set_repo('mozilla-beta') self.logger.info("Using tag %s for release %s" % (new_value, value)) value = new_value else: new_value = parse_date(date_of_release(value)) self.logger.info("Using date %s for release %s" % (new_value, value)) value = new_value except UnavailableRelease: self.logger.info("%s is not a release, assuming it's a hash..." % value) return value
def _convert_to_bisect_arg(self, value): """ Transform a string value to a date or datetime if it looks like it. """ try: value = parse_date(value) except DateFormatError: try: repo = self.options.repo if (get_name(repo) == 'mozilla-release' or (not repo and re.match(r'^\d+\.\d\.\d$', value))): new_value = tag_of_release(value) if not repo: self.logger.info("Assuming repo mozilla-release") self.fetch_config.set_repo('mozilla-release') self.logger.info("Using tag %s for release %s" % (new_value, value)) value = new_value elif (get_name(repo) == 'mozilla-beta' or (not repo and re.match(r'^\d+\.0b\d+$', value))): new_value = tag_of_beta(value) if not repo: self.logger.info("Assuming repo mozilla-beta") self.fetch_config.set_repo('mozilla-beta') self.logger.info("Using tag %s for release %s" % (new_value, value)) value = new_value else: new_value = parse_date(date_of_release(value)) self.logger.info("Using date %s for release %s" % (new_value, value)) value = new_value except UnavailableRelease: self.logger.info("%s is not a release, assuming it's a hash..." % value) return value
def test_invalid_beta_tags(self): with self.assertRaises(errors.UnavailableRelease): tag_of_beta('57.0.1') with self.assertRaises(errors.UnavailableRelease): tag_of_beta('xyz')
def test_invalid_beta_tags(self): with self.assertRaises(errors.UnavailableRelease): tag_of_beta('57.0.1') with self.assertRaises(errors.UnavailableRelease): tag_of_beta('xyz')