~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ignores.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-03-30 05:12:24 UTC
  • mfrom: (5121.1.1 183504-ignores)
  • Revision ID: pqm@pqm.ubuntu.com-20100330051224-a8ubi9w2cd0upyb5
(mbp, for jspashett) cope with non-utf8 data in the ignore file

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    def test_parse_empty(self):
51
51
        ignored = ignores.parse_ignore_file(StringIO(''))
52
52
        self.assertEqual(set([]), ignored)
 
53
        
 
54
    def test_parse_non_utf8(self):
 
55
        """Lines with non utf 8 characters should be discarded."""
 
56
        ignored = ignores.parse_ignore_file(StringIO(
 
57
                'utf8filename_a\n'
 
58
                'invalid utf8\x80\n'
 
59
                'utf8filename_b\n'
 
60
                ))
 
61
        self.assertEqual(set([
 
62
                        'utf8filename_a',
 
63
                        'utf8filename_b',
 
64
                       ]), ignored)
53
65
 
54
66
 
55
67
class TestUserIgnores(TestCaseInTempDir):