def setUp(self): # Setup logging logging.basicConfig(level=logging.ERROR) self.parser = GitParser() self.parser.detect(os.path.dirname(os.path.realpath(__file__))+"/data/testdatarepository") pass
class GitParserTest(unittest.TestCase): parser = None def setUp(self): # Setup logging logging.basicConfig(level=logging.ERROR) self.parser = GitParser() self.parser.detect( os.path.dirname(os.path.realpath(__file__)) + "/data/gitRepo") pass def test_detect(self): self.assertFalse(self.parser.detect("./nonsense/path")) pass def test_repositoryType(self): self.assertEqual(self.parser.repositoryType, "git") pass def test_getProjectURLOfLocalProject(self): self.assertTrue(self.parser.getProjectURL().startswith("local")) def test_getProjectNameOfLocalProject(self): try: val = uuid.UUID(self.parser.getProjectName(), version=4) except ValueError: fail("Not a valid uuid!")
class GitParserTest(unittest.TestCase): parser = None def setUp(self): # Setup logging logging.basicConfig(level=logging.ERROR) self.parser = GitParser() self.parser.detect(os.path.dirname(os.path.realpath(__file__))+"/data/testdatarepository") pass def test_detect(self): self.assertFalse(self.parser.detect("./nonsense/path")) pass def test_repositoryType(self): self.assertEqual(self.parser.repository_type, "git") pass
def setUpClass(cls): # Setup logging logging.basicConfig(level=logging.ERROR) cls.parser = GitParser() cls.parser.detect(os.path.dirname(os.path.realpath(__file__))+"/data/testdatarepository") cls.parser.initialize() datastore = DatastoreMock() cls.parser.parse(os.path.dirname(os.path.realpath(__file__))+"/data/testdatarepository", datastore) # get the commits from our mockdatastore queue = datastore.get_commit_queue() while(queue.empty() == False): cls.listOfCommits.append(queue.get()) # sort the generated list cls.listOfCommits.sort(key=lambda x: x.committerDate)