def test_gitBranch(self): branch = PetscVersion.gitBranch() if PetscVersion.isRelease(): self.assertEqual("unknown", branch) else: self.failIf(len(branch) == 0) return
def test_gitBranch(self): branch = PetscVersion.gitBranch() if PetscVersion.isRelease(): pass else: self.assertFalse(len(branch) == 0) return
def test_gitVersion(self): revision = PetscVersion.gitRevision() if PetscVersion.isRelease(): self.assertEqual("unknown", revision) else: # Check that revision is of the form v2.1.3-16-g9323114 or v3.10-88-g06a760874e import re match = re.search("v[0-9]+\.[0-9]+(\.[0-9]+)*-[0-9]+-g[0-9,a-z]+", revision) self.failIf(match is None) return
def test_gitVersion(self): revision = PetscVersion.gitRevision() if PetscVersion.isRelease(): self.assertEqual("unknown", revision) else: # Check that revision is of the form v2.1.3-16-g9323114 import re match = re.search("v[0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g[0-9,a-z]+", revision) self.failIf(match is None) return
def test_gitDate(self): value = PetscVersion.gitDate() if PetscVersion.isRelease(): pass else: # Check form of datetime import datetime fields = value.split() d = datetime.datetime.strptime(fields[0], "%Y-%m-%d") t = datetime.datetime.strptime(fields[1], "%H:%M:%S") return
def test_gitDate(self): value = PetscVersion.gitDate() if PetscVersion.isRelease(): self.assertEqual("unknown", value) else: # Check form of datetime import datetime fields = value.split() d = datetime.datetime.strptime(fields[0], "%Y-%m-%d") t = datetime.datetime.strptime(fields[1], "%H:%M:%S") return
def test_isRelease(self): isRelease = PetscVersion.isRelease() return