Ejemplo n.º 1
0
 def test_all_semvers_to_version(self):
     """ Check that all valid semvers validate and are converted to major.minor versions correctly """
     for x in range(256):
         for y in range(256):
             self.assertEqual(
                 version.semver_to_version("{}.{}.0".format(x, y)),
                 "{}.{}".format(x, y))
Ejemplo n.º 2
0
 def semver(self, value):
     """ Set the app's version label from a semver string. """
     if self.project_type == 'package':
         # This throws an error if the semver is invalid.
         parse_semver(value)
         self.app_version_label = value
     else:
         self.app_version_label = semver_to_version(value)
Ejemplo n.º 3
0
 def semver(self, value):
     """ Set the app's version label from a semver string. """
     if self.project_type == 'package':
         # This throws an error if the semver is invalid.
         parse_semver(value)
         self.app_version_label = value
     else:
         self.app_version_label = semver_to_version(value)
 def test_semvers_discard_patch(self):
     """ Check that semver_to_version() discards the patch number. """
     self.assertEqual(version.semver_to_version("1.2.3"), "1.2")
 def test_semvers_to_version(self):
     """ Check that valid x.y.0 semvers validate and are converted to major.minor versions correctly """
     for x in range(256):
         for y in range(256):
             self.assertEqual(version.semver_to_version("{}.{}.0".format(x, y)), "{}.{}".format(x, y))
 def run_invalid_semver_test(self, semver):
     with self.assertRaises(ValueError):
         version.semver_to_version(semver)
Ejemplo n.º 7
0
 def run_invalid_semver_test(self, semver):
     with self.assertRaises(ValueError):
         version.semver_to_version(semver)
Ejemplo n.º 8
0
 def semver(self, value):
     """ Set the app's version label from a semver string"""
     self.app_version_label = semver_to_version(value)
Ejemplo n.º 9
0
 def test_semvers_discard_patch(self):
     """ Check that semver_to_version() discards the patch number. """
     self.assertEqual(version.semver_to_version("1.2.3"), "1.2")
Ejemplo n.º 10
0
 def semver(self, value):
     """ Set the app's version label from a semver string"""
     self.app_version_label = semver_to_version(value)