~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_matchers.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-20 15:56:56 UTC
  • mfrom: (6437.3.16 2.5)
  • mto: (6437.3.19 2.5)
  • mto: This revision was merged to the branch mainline in revision 6444.
  • Revision ID: jelmer@samba.org-20120120155656-frygh6clinh5rr0q
MergeĀ lp:bzr/2.5.

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())