~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_matchers.py

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
        self.assertEquals([calls[0].call], mismatch.vfs_calls)
179
179
        self.assertEquals("no VFS calls expected, got: append('file')""",
180
180
                mismatch.describe())
 
181
 
 
182
 
 
183
class TestRevisionHistoryMatches(TestCaseWithTransport):
 
184
 
 
185
    def test_empty(self):
 
186
        tree = self.make_branch_and_tree('.')
 
187
        matcher = RevisionHistoryMatches([])
 
188
        self.assertIs(None, matcher.match(tree.branch))
 
189
 
 
190
    def test_matches(self):
 
191
        tree = self.make_branch_and_tree('.')
 
192
        tree.commit('msg1', rev_id='a')
 
193
        tree.commit('msg2', rev_id='b')
 
194
        matcher = RevisionHistoryMatches(['a', 'b'])
 
195
        self.assertIs(None, matcher.match(tree.branch))
 
196
 
 
197
    def test_mismatch(self):
 
198
        tree = self.make_branch_and_tree('.')
 
199
        tree.commit('msg1', rev_id='a')
 
200
        tree.commit('msg2', rev_id='b')
 
201
        matcher = RevisionHistoryMatches(['a', 'b', 'c'])
 
202
        self.assertEquals(
 
203
            "['a', 'b', 'c'] != ['a', 'b']",
 
204
            matcher.match(tree.branch).describe())