~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_rules.py

  • Committer: Ian Clatworthy
  • Date: 2008-07-18 09:32:13 UTC
  • mfrom: (3564.1.1 bzr.rules-fix)
  • mto: This revision was merged to the branch mainline in revision 3565.
  • Revision ID: ian.clatworthy@canonical.com-20080718093213-e86mzwqm71r6bn2x
Fix RuleSearcher to return () not [] (Ian Clatworthy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
    def test_get_items_file_missing(self):
46
46
        rs = self.make_searcher(None)
47
 
        self.assertEquals([], rs.get_items('a.txt'))
48
 
        self.assertEquals([], rs.get_selected_items('a.txt', ['foo']))
 
47
        self.assertEquals((), rs.get_items('a.txt'))
 
48
        self.assertEquals((), rs.get_selected_items('a.txt', ['foo']))
49
49
 
50
50
    def test_get_items_file_empty(self):
51
51
        rs = self.make_searcher("")
52
 
        self.assertEquals([], rs.get_items('a.txt'))
53
 
        self.assertEquals([], rs.get_selected_items('a.txt', ['foo']))
 
52
        self.assertEquals((), rs.get_items('a.txt'))
 
53
        self.assertEquals((), rs.get_selected_items('a.txt', ['foo']))
54
54
 
55
55
    def test_get_items_from_extension_match(self):
56
56
        rs = self.make_searcher("[name *.txt]\nfoo=bar\na=True\n")
57
 
        self.assertEquals([], rs.get_items('a.py'))
 
57
        self.assertEquals((), rs.get_items('a.py'))
58
58
        self.assertEquals((('foo', 'bar'), ('a', 'True')),
59
59
            rs.get_items('a.txt'))
60
60
        self.assertEquals((('foo', 'bar'), ('a', 'True')),
66
66
        rs = self.make_searcher("[name ./a.txt]\nfoo=baz\n")
67
67
        self.assertEquals((('foo', 'baz'),),
68
68
            rs.get_items('a.txt'))
69
 
        self.assertEquals([], rs.get_items('dir/a.txt'))
 
69
        self.assertEquals((), rs.get_items('dir/a.txt'))
70
70
 
71
71
    def test_get_items_match_first(self):
72
72
        rs = self.make_searcher(