~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revision.py

  • Committer: John Arbash Meinel
  • Date: 2010-05-11 10:45:26 UTC
  • mto: This revision was merged to the branch mainline in revision 5225.
  • Revision ID: john@arbash-meinel.com-20100511104526-zxnstcxta22hzw2n
Implement a compiled extension for parsing the text key out of a CHKInventory value.

Related to bug #562666. This seems to shave 5-10% out of the time spent doing a complete
branch of bzr.dev/launchpad/etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
        self.assertEqual('a', r.get_summary())
209
209
        r.message = '\na\nb'
210
210
        self.assertEqual('a', r.get_summary())
 
211
        r.message = None
 
212
        self.assertEqual('', r.get_summary())
211
213
 
212
214
    def test_get_apparent_author(self):
213
215
        r = revision.Revision('1')
227
229
                r.get_apparent_author)
228
230
        self.assertEqual('C', author)
229
231
 
 
232
    def test_get_apparent_author_none(self):
 
233
        r = revision.Revision('1')
 
234
        author = self.applyDeprecated(
 
235
                symbol_versioning.deprecated_in((1, 13, 0)),
 
236
                r.get_apparent_author)
 
237
        self.assertEqual(None, author)
 
238
 
230
239
    def test_get_apparent_authors(self):
231
240
        r = revision.Revision('1')
232
241
        r.committer = 'A'
236
245
        r.properties['authors'] = 'C\nD'
237
246
        self.assertEqual(['C', 'D'], r.get_apparent_authors())
238
247
 
 
248
    def test_get_apparent_authors_no_committer(self):
 
249
        r = revision.Revision('1')
 
250
        self.assertEqual([], r.get_apparent_authors())
 
251
 
239
252
 
240
253
class TestRevisionBugs(TestCase):
241
254
    """Tests for getting the bugs that a revision is linked to."""