Пример #1
0
	def test_gera_nenhum_commit_from_empty_log(self):
		log = list()
		log.append("")
		log.append("")
		log.append("")
		fac = CommitFactory(log)
		commits = fac.gera_commits()
		self.assertEqual(0,len(commits))
Пример #2
0
 def test_gera_nenhum_commit_from_empty_log(self):
     log = list()
     log.append("")
     log.append("")
     log.append("")
     fac = CommitFactory(log)
     commits = fac.gera_commits()
     self.assertEqual(0, len(commits))
Пример #3
0
	def test_gera_um_commit_from_log(self):
		log = list()
		log.append("")
		log.append(self.__commit_string())
		log.append(self.__commit_stats())
		log.append("")
		fac = CommitFactory(log)
		commits = fac.gera_commits()
		self.assertEqual(1,len(commits))
Пример #4
0
 def test_gera_um_commit_from_log(self):
     log = list()
     log.append("")
     log.append(self.__commit_string())
     log.append(self.__commit_stats())
     log.append("")
     fac = CommitFactory(log)
     commits = fac.gera_commits()
     self.assertEqual(1, len(commits))
Пример #5
0
	def test_gera_commit_from_string(self):
		fac = CommitFactory(list())
		data = datetime.strptime("2011-05-14 15:30:56","%Y-%m-%d %H:%M:%S" )
		commit = fac.gera_commit(commit_string = self.__commit_string(), commit_stats = self.__commit_stats())
		self.assertEqual("Nico Steppat", commit.autor.nome)
		self.assertEqual("*****@*****.**", commit.autor.email)
		self.assertEqual(data, commit.data_autor)
		self.assertEqual("Nico Steppat", commit.committer.nome)
		self.assertEqual("*****@*****.**", commit.committer.email)
		self.assertEqual(data, commit.data_commit)
		self.assertEqual("e8308a05426ba7ab71cc91f70d8b943ce72b84a4", commit.sha_hash)
		self.assertEqual("Initial commit", commit.mensagem)
Пример #6
0
 def test_gera_commit_from_string(self):
     fac = CommitFactory(list())
     data = datetime.strptime("2011-05-14 15:30:56", "%Y-%m-%d %H:%M:%S")
     commit = fac.gera_commit(commit_string=self.__commit_string(),
                              commit_stats=self.__commit_stats())
     self.assertEqual("Nico Steppat", commit.autor.nome)
     self.assertEqual("*****@*****.**", commit.autor.email)
     self.assertEqual(data, commit.data_autor)
     self.assertEqual("Nico Steppat", commit.committer.nome)
     self.assertEqual("*****@*****.**", commit.committer.email)
     self.assertEqual(data, commit.data_commit)
     self.assertEqual("e8308a05426ba7ab71cc91f70d8b943ce72b84a4",
                      commit.sha_hash)
     self.assertEqual("Initial commit", commit.mensagem)