def test(self): git = Git(self._root_dir) git.ignore('foo') self.assertTrue(os.path.isfile(Git.GITIGNORE)) self.assertEqual(self._count_gitignore(), 1) git.ignore('foo') self.assertEqual(self._count_gitignore(), 1) git.ignore_remove('foo') self.assertEqual(self._count_gitignore(), 0)
def test_ignore(self): git = Git(self._root_dir) foo = os.path.join(self._root_dir, self.FOO) git.ignore(foo) self.assertTrue(os.path.isfile(Git.GITIGNORE)) self.assertEqual(self._count_gitignore(), 1) git.ignore(foo) self.assertEqual(self._count_gitignore(), 1) git.ignore_remove(foo) self.assertEqual(self._count_gitignore(), 0)
def test_ignore(self, git, repo_dir): git = Git(repo_dir._root_dir) foo = os.path.join(repo_dir._root_dir, repo_dir.FOO) target = "/" + repo_dir.FOO git.ignore(foo) assert os.path.isfile(Git.GITIGNORE) assert self._count_gitignore_entries(target) == 1 git.ignore(foo) assert os.path.isfile(Git.GITIGNORE) assert self._count_gitignore_entries(target) == 1 git.ignore_remove(foo) assert self._count_gitignore_entries(target) == 0