Esempio n. 1
0
 def _find_matching_tag(self, distribution_version):
     tags = git.tags(self.repo_dir)
     for version in versions.versions(distribution_version):
         # tags have a "v" prefix by convention.
         tag_candidate = "v{}".format(version)
         if tag_candidate in tags:
             return tag_candidate
     return None
Esempio n. 2
0
 def test_versions_rejects_invalid_version_strings(self):
     with self.assertRaises(exceptions.InvalidSyntax) as ctx:
         versions.versions("5.0.0a-SNAPSHOT")
     self.assertEqual(
         "version string '5.0.0a-SNAPSHOT' does not conform to pattern '^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$'",
         ctx.exception.args[0])
Esempio n. 3
0
 def test_versions_parses_correct_version_string(self):
     self.assertEqual(["5.0.3", "5.0", "5"], versions.versions("5.0.3"))
     self.assertEqual(["5.0.0-SNAPSHOT", "5.0.0", "5.0", "5"],
                      versions.versions("5.0.0-SNAPSHOT"))
     self.assertEqual(["10.3.63", "10.3", "10"],
                      versions.versions("10.3.63"))
Esempio n. 4
0
 def test_versions_rejects_invalid_version_strings(self):
     with self.assertRaises(exceptions.InvalidSyntax) as ctx:
         versions.versions("5.0.0a-SNAPSHOT")
     self.assertEqual("version string '5.0.0a-SNAPSHOT' does not conform to pattern '^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$'"
                      , ctx.exception.args[0])
Esempio n. 5
0
 def test_versions_parses_correct_version_string(self):
     self.assertEqual(["5.0.3", "5.0", "5"], versions.versions("5.0.3"))
     self.assertEqual(["5.0.0-SNAPSHOT", "5.0.0", "5.0", "5"], versions.versions("5.0.0-SNAPSHOT"))
     self.assertEqual(["10.3.63", "10.3", "10"], versions.versions("10.3.63"))