/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2006-10-31 19:39:21 UTC
  • mfrom: (2077.1.2 bzr.lp4559)
  • mto: This revision was merged to the branch mainline in revision 2105.
  • Revision ID: john@arbash-meinel.com-20061031193921-6d047611ba22c665
(Kent Gibson) Fix bug #4559, strip trailing slashes from ignore patterns

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
class TestCommands(ExternalBase):
45
45
 
 
46
    def test_ignore_absolutes(self):
 
47
        """'ignore' with an absolute path returns an error"""
 
48
        self.runbzr('init')
 
49
        self.run_bzr_error(('bzr: ERROR: NAME_PATTERN should not '
 
50
                            'be an absolute path\n',),
 
51
                           'ignore','/crud')
 
52
        
 
53
    def test_ignore_directories(self):
 
54
        """ignoring a directory should ignore directory tree.
 
55
 
 
56
        Also check that trailing slashes on directories are stripped.
 
57
        """
 
58
        self.runbzr('init')
 
59
        self.build_tree(['dir1/', 'dir1/foo',
 
60
                         'dir2/', 'dir2/bar',
 
61
                         'dir3/', 'dir3/baz'])
 
62
        self.runbzr('ignore dir1 dir2/')
 
63
        self.check_file_contents('.bzrignore', 'dir1\ndir2\n')
 
64
        self.assertEquals(self.capture('unknowns'), 'dir3\n')
 
65
 
46
66
    def test_ignore_patterns(self):
47
67
        self.runbzr('init')
48
68
        self.assertEquals(self.capture('unknowns'), '')
76
96
        self.assertEquals(self.capture('unknowns'), '')
77
97
        self.check_file_contents('.bzrignore', '*.blah\ngarh\n')
78
98
       
79
 
    def test_ignore_multiple_arguments(self): 
 
99
    def test_ignore_multiple_arguments(self):
80
100
        """'ignore' works with multiple arguments"""
81
101
        self.runbzr('init')
82
102
        self.build_tree(['a','b','c','d'])
84
104
        self.runbzr('ignore a b c')
85
105
        self.assertEquals(self.capture('unknowns'), 'd\n')
86
106
        self.check_file_contents('.bzrignore', 'a\nb\nc\n')
87
 
        
 
107
 
 
108
    def test_ignore_no_arguments(self):
 
109
        """'ignore' with no arguments returns an error"""
 
110
        self.runbzr('init')
 
111
        self.run_bzr_error(('bzr: ERROR: ignore requires at least one '
 
112
                            'NAME_PATTERN or --old-default-rules\n',),
 
113
                           'ignore')
 
114
 
88
115
    def test_ignore_old_defaults(self):
89
116
        out, err = self.run_bzr('ignore', '--old-default-rules')
90
117
        self.assertContainsRe(out, 'CVS')
91
118
        self.assertEqual('', err)
 
119