~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-06-30 00:47:30 UTC
  • mto: (3515.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3516.
  • Revision ID: ian.clatworthy@canonical.com-20080630004730-mbd1jiwipzdg15hc
changed API design as requested by jam during review

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(None, rs.get_items('a.txt'))
48
 
        self.assertEquals(None, rs.get_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(None, rs.get_items('a.txt'))
53
 
        self.assertEquals(None, rs.get_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(None, 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')),
61
61
            rs.get_items('dir/a.txt'))
62
62
        self.assertEquals((('foo', 'bar'),),
63
 
            rs.get_items('a.txt', ['foo']))
 
63
            rs.get_selected_items('a.txt', ['foo']))
64
64
 
65
65
    def test_get_items_pathname_match(self):
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(None, 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(