def testChromeVersionDecrementVersionIllegalUsage(self): chrome_version = apk_finder.ChromeVersion('68.0.3440.70') with self.assertRaises(AssertionError): chrome_version.GetDecrementedVersionNum(71) with self.assertRaises(AssertionError): chrome_version.GetDecrementedVersionNum(600)
def testChromeVersionDecrementVersionNormalUsage(self): chrome_version = apk_finder.ChromeVersion('68.0.3440.70') self.assertEqual('68.0.3440.64', str(chrome_version.GetDecrementedVersionNum(6))) self.assertEqual('68.0.3440.0', str(chrome_version.GetDecrementedVersionNum(70)))
def testChromeVersionConstructUsingFourInts(self): chrome_version = apk_finder.ChromeVersion(68, 0, 3440, 64) self.assertEqual(68, chrome_version.milestone) self.assertEqual(0, chrome_version.minor) self.assertEqual(3440, chrome_version.build) self.assertEqual(64, chrome_version.patch)
def testChromeVersionStringRepresentation(self): self.assertEqual('68.0.3440.64', str(apk_finder.ChromeVersion(68, 0, 3440, 64))) self.assertEqual('68.0.3440.64', str(apk_finder.ChromeVersion('68.0.3440.64')))
def testChromeVersionConstructUsingString(self): chrome_version = apk_finder.ChromeVersion('68.0.3440.64') self.assertEqual(68, chrome_version.milestone) self.assertEqual(0, chrome_version.minor) self.assertEqual(3440, chrome_version.build) self.assertEqual(64, chrome_version.patch)