print "Result: %d" % result if i in (22, 26, 29,): assert result == 1 else: assert result == 0 print_header("Testing ordered_filename_pre_commit") for i in revisions(40, 56): cd = CommitDetails(REPO, i, test_mode=True) rd = RepositoryDetails(REPO, i, test_mode=True) result = check_filenames(cd, rd) print "Result: %d" % result if i in (45, 49,): assert result == 1 elif i in (51, 52,): # 52 is a rename, without order change. Could be allowed assert result == 2 else: assert result == 0 for i in revisions(50, 66): cd = CommitDetails(REPO, i, test_mode=True) result = fail_on_tag_changes(cd) print "Result: %d" % result if i in (60, 65, 66,): assert result == 1 else: assert result == 0 print "Success!"
rd = RepositoryDetails(REPO, i, test_mode=True) result = check_filenames(cd, rd) print "Result: %d" % result if i in ( 45, 49, ): assert result == 1 elif i in ( 51, 52, ): # 52 is a rename, without order change. Could be allowed assert result == 2 else: assert result == 0 for i in revisions(50, 66): cd = CommitDetails(REPO, i, test_mode=True) result = fail_on_tag_changes(cd) print "Result: %d" % result if i in ( 60, 65, 66, ): assert result == 1 else: assert result == 0 print "Success!"
def then_error_code_is(self, error_code): self.assertEqual(error_code, fail_on_tag_changes(self.commit_details))
def test_prints_error_message_when_committing_to_tag(self): self.given_file_in_commit("module/tags/tagname/file.txt") fail_on_tag_changes(self.commit_details) verify(self.stderr).write("Error: Modifying tagged files is not permitted!\n")
def test_prints_error_message_when_committing_to_tag(self): self.given_file_in_commit("module/tags/tagname/file.txt") fail_on_tag_changes(self.commit_details) verify(self.stderr).write( "Error: Modifying tagged files is not permitted!\n")
def then_error_code_is(self, error_code): self.assertEqual(error_code, fail_on_tag_changes(self.commit_details))