~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_ignore.py

  • Committer: Vincent Ladeuil
  • Date: 2016-02-01 18:09:18 UTC
  • mfrom: (6614.1.3 assert)
  • mto: This revision was merged to the branch mainline in revision 6615.
  • Revision ID: v.ladeuil+lp@free.fr-20160201180918-jqtq8ol6gdbbbtpv
Fix deprecated assertions to unblock release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2010, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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')
62
62
 
63
63
    def test_ignore_patterns(self):
64
64
        tree = self.make_branch_and_tree('.')
65
65
 
66
 
        self.assertEquals(list(tree.unknowns()), [])
 
66
        self.assertEqual(list(tree.unknowns()), [])
67
67
 
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
71
71
 
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()), [])
75
75
 
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'])
78
78
 
79
79
        tree.add('foo.c')
80
 
        self.assertEquals(list(tree.unknowns()), [])
 
80
        self.assertEqual(list(tree.unknowns()), [])
81
81
 
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')
88
88
 
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')
95
95
 
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')
104
104
 
105
105
    def test_ignore_no_arguments(self):