def test_add_duplicate(self): """Adding the same ignore twice shouldn't add a new entry.""" ignores.add_runtime_ignores(['foo', 'bar']) self.assertEqual(set(['foo', 'bar']), ignores.get_runtime_ignores()) ignores.add_runtime_ignores(['bar']) self.assertEqual(set(['foo', 'bar']), ignores.get_runtime_ignores())
def test_runtime_ignores(self): tree = self.make_branch_and_tree('.') self.build_tree_contents([('.bzrignore', '')]) ignores._set_user_ignores([]) orig_runtime = ignores._runtime_ignores try: ignores._runtime_ignores = set() self.assertEqual(None, tree.is_ignored('foobar.py')) tree._flush_ignore_list_cache() ignores.add_runtime_ignores(['./foobar.py']) self.assertEqual(set(['./foobar.py']), ignores.get_runtime_ignores()) self.assertEqual('./foobar.py', tree.is_ignored('foobar.py')) finally: ignores._runtime_ignores = orig_runtime
def test_add(self): """Test that we can add an entry to the list.""" self.assertEqual(set(), ignores.get_runtime_ignores()) ignores.add_runtime_ignores(['foo']) self.assertEqual(set(['foo']), ignores.get_runtime_ignores())