def test_changes_nested(self): existing = Path(self.nested, 'existing_nested.txt') existing.write_text('text', encoding='UTF-8') self.assertTrue(repo_file_add_or_changed(self.repo, existing))
def test_new_nested(self): existing = Path(self.nested, 'existing.txt') existing.touch() self.assertTrue(repo_file_add_or_changed(self.repo, existing))
def test_changes(self): existing = Path(self.working, 'existing.txt') existing.write_text('I made a change', encoding='UTF-8') self.assertTrue(repo_file_add_or_changed(self.repo, existing))
def test_no_changes(self): existing = Path(self.working, 'existing.txt') existing.touch() self.assertFalse(repo_file_add_or_changed(self.repo, existing))
def test_new_file(self): new_file = Path(self.working, 'newfile.txt') new_file.touch() self.assertTrue(repo_file_add_or_changed(self.repo, new_file))
def test_no_file(self): no_file = Path(self.working, 'newfile.txt') self.assertFalse(repo_file_add_or_changed(self.repo, no_file))