/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/test_ignores.py

  • Committer: v.ladeuil+lp at free
  • Date: 2006-11-08 07:44:30 UTC
  • mfrom: (2123 +trunk)
  • mto: (2145.1.1 keepalive)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: v.ladeuil+lp@free.fr-20061108074430-a9c08d4a475bd97f
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
        self.assertEqual(patterns, added)
100
100
        self.assertEqual(set(patterns), ignores.get_user_ignores())
101
101
 
 
102
    def test_add_directory(self):
 
103
        """Test that adding a directory will strip any trailing slash"""
 
104
        # Create an empty file
 
105
        ignores._set_user_ignores([])
 
106
 
 
107
        in_patterns = ['foo/', 'bar/']
 
108
        added = ignores.add_unique_user_ignores(in_patterns)
 
109
        out_patterns = [ x.rstrip('/') for x in in_patterns ]
 
110
        self.assertEqual(out_patterns, added)
 
111
        self.assertEqual(set(out_patterns), ignores.get_user_ignores())
 
112
 
102
113
    def test_add_unique(self):
103
114
        """Test that adding will not duplicate ignores"""
104
 
        ignores._set_user_ignores(['foo', './bar', u'b\xe5z'])
 
115
        ignores._set_user_ignores(['foo', './bar', u'b\xe5z', 'dir1/'])
105
116
 
106
 
        added = ignores.add_unique_user_ignores(['xxx', './bar', 'xxx'])
107
 
        self.assertEqual(['xxx'], added)
108
 
        self.assertEqual(set(['foo', './bar', u'b\xe5z', 'xxx']),
 
117
        added = ignores.add_unique_user_ignores(
 
118
            ['xxx', './bar', 'xxx', 'dir1/', 'dir2/'])
 
119
        self.assertEqual(['xxx', 'dir2'], added)
 
120
        self.assertEqual(set(['foo', './bar', u'b\xe5z', 
 
121
                              'xxx', 'dir1', 'dir2']),
109
122
                         ignores.get_user_ignores())
110
123
 
111
124