Example #1
0
def createSemVers(line):
    match = line_re.match(line)
    left_str = match.groups()[0]
    right_str = match.groups()[2]

    leftSV = semver.SemVer(left_str)
    rightSV = semver.SemVer(right_str)

    return leftSV, rightSV
Example #2
0
 def test_run_no_merge(self):
     semver_object = semver.SemVer()
     try:
         result = semver_object.run(False)
     except Exception as e:
         if e == NO_MERGE_FOUND:
             self.assertTrue(True)
         else:
             self.assertTrue(False)
Example #3
0
 def setUp(self):
     self.sv1Str = 'v1.2.3-alpha.0+build123-42-g123abcd'
     self.sv1 = semver.SemVer(self.sv1Str)
     self.sv2Str = 'v1.2.3'
     self.sv2 = semver.SemVer(self.sv2Str)
     self.sv3Str = 'v1.2.3-alpha.0+11-gabcd123'
     self.sv3 = semver.SemVer(self.sv3Str)
     self.svMajorBig = semver.SemVer('9.4.2')
     self.svMajorSmall = semver.SemVer('1.5.8')
     self.svMinorBig = semver.SemVer('1.9.4')
     self.svMinorSmall = semver.SemVer('1.4.8')
     self.svPatchBig = semver.SemVer('1.9.13')
     self.svPatchSmall = semver.SemVer('1.9.5')
     self.svPrerelBig = semver.SemVer('2.3.4-beta.2')
     self.svPrerelSmall = semver.SemVer('2.3.4-alpha.0')
Example #4
0
 def test_get_version_type_patch_merge(self):
     semver_object = semver.SemVer()
     semver_object.merged_branch = "patch/unittest"
     semver_object.get_version_type()
     self.assertEqual(semver_object.version_type, semver.VersionType.PATCH)
Example #5
0
 def test_get_version_type_minor_merge(self):
     semver_object = semver.SemVer()
     semver_object.merged_branch = "minor/unittest"
     semver_object.get_version_type()
     self.assertEqual(semver_object.version_type, semver.VersionType.MINOR)