58
58
'dir3/', 'dir3/baz'])
59
59
self.run_bzr(['ignore', 'dir1', 'dir2/', 'dir4\\'])
60
60
self.check_file_contents('.bzrignore', 'dir1\ndir2\ndir4\n')
61
self.assertEquals(self.run_bzr('unknowns')[0], 'dir3\n')
61
self.assertEqual(self.run_bzr('unknowns')[0], 'dir3\n')
63
63
def test_ignore_patterns(self):
64
64
tree = self.make_branch_and_tree('.')
66
self.assertEquals(list(tree.unknowns()), [])
66
self.assertEqual(list(tree.unknowns()), [])
68
68
# is_ignored() will now create the user global ignore file
69
69
# if it doesn't exist, so make sure we ignore it in our tests
72
72
self.build_tree_contents(
73
73
[('foo.tmp', '.tmp files are ignored by default')])
74
self.assertEquals(list(tree.unknowns()), [])
74
self.assertEqual(list(tree.unknowns()), [])
76
76
self.build_tree_contents([('foo.c', 'int main() {}')])
77
self.assertEquals(list(tree.unknowns()), ['foo.c'])
77
self.assertEqual(list(tree.unknowns()), ['foo.c'])
80
self.assertEquals(list(tree.unknowns()), [])
80
self.assertEqual(list(tree.unknowns()), [])
82
82
# 'ignore' works when creating the .bzrignore file
83
83
self.build_tree_contents([('foo.blah', 'blah')])
84
self.assertEquals(list(tree.unknowns()), ['foo.blah'])
84
self.assertEqual(list(tree.unknowns()), ['foo.blah'])
85
85
self.run_bzr('ignore *.blah')
86
self.assertEquals(list(tree.unknowns()), [])
86
self.assertEqual(list(tree.unknowns()), [])
87
87
self.check_file_contents('.bzrignore', '*.blah\n')
89
89
# 'ignore' works when then .bzrignore file already exists
90
90
self.build_tree_contents([('garh', 'garh')])
91
self.assertEquals(list(tree.unknowns()), ['garh'])
91
self.assertEqual(list(tree.unknowns()), ['garh'])
92
92
self.run_bzr('ignore garh')
93
self.assertEquals(list(tree.unknowns()), [])
93
self.assertEqual(list(tree.unknowns()), [])
94
94
self.check_file_contents('.bzrignore', '*.blah\ngarh\n')
96
96
def test_ignore_multiple_arguments(self):
97
97
"""'ignore' works with multiple arguments"""
98
98
tree = self.make_branch_and_tree('.')
99
99
self.build_tree(['a','b','c','d'])
100
self.assertEquals(list(tree.unknowns()), ['a', 'b', 'c', 'd'])
100
self.assertEqual(list(tree.unknowns()), ['a', 'b', 'c', 'd'])
101
101
self.run_bzr('ignore a b c')
102
self.assertEquals(list(tree.unknowns()), ['d'])
102
self.assertEqual(list(tree.unknowns()), ['d'])
103
103
self.check_file_contents('.bzrignore', 'a\nb\nc\n')
105
105
def test_ignore_no_arguments(self):