def vcheck_versionfails_test(self): on_version_ind = -1 self.mockrepo_real(on_version_ind=on_version_ind) self.assertFalse(vcheck.vcheck(self.mod2check, version=unpresent_version))
def vcheck_versionerrors_test(self): with self.assertRaisesRegex(vcheck.VersionError, 'Repo for module .* does not match a released version.'): vcheck.vcheck(self.mod2check, version=unpresent_version)
def vcheck_versionmatches_test(self): on_version_ind = -1 self.mockrepo_real(on_version_ind=on_version_ind) self.assertTrue(vcheck.vcheck(self.mod2check, version=current_versions[on_version_ind]))
def vcheck_hexshafails_test(self): self.assertFalse(vcheck.vcheck(self.mod2check, hexsha=unpresent_hexsha))
def vcheck_hexshamatches_test(self): self.assertTrue(vcheck.vcheck(self.mod2check, hexsha=current_hexsha))
def vcheck_notenoughargs_test(self): on_version_ind = -1 self.mockrepo_real(on_version_ind=on_version_ind) with self.assertRaisesRegex(ValueError, 'Neither hexsha nor version specified'): vcheck.vcheck(self.mod2check)
def vcheck_toomanyargs_test(self): on_version_ind = -1 self.mockrepo_real(on_version_ind=on_version_ind) with self.assertRaisesRegex(ValueError, 'Only specify either hexsha (.*) or version(.*)'): vcheck.vcheck(self.mod2check, hexsha=current_hexshas[on_version_ind] , version=current_versions[on_version_ind])