~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: 2009-03-27 22:29:55 UTC
  • mto: (3735.39.2 clean)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090327222955-utifmfm888zerixt
Implement apply_delta_to_source which doesn't have to malloc another string.

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
 
 
212
    def test_get_apparent_author(self):
 
213
        r = revision.Revision('1')
 
214
        r.committer = 'A'
 
215
        author = self.applyDeprecated(
 
216
                symbol_versioning.deprecated_in((1, 13, 0)),
 
217
                r.get_apparent_author)
 
218
        self.assertEqual('A', author)
 
219
        r.properties['author'] = 'B'
 
220
        author = self.applyDeprecated(
 
221
                symbol_versioning.deprecated_in((1, 13, 0)),
 
222
                r.get_apparent_author)
 
223
        self.assertEqual('B', author)
 
224
        r.properties['authors'] = 'C\nD'
 
225
        author = self.applyDeprecated(
 
226
                symbol_versioning.deprecated_in((1, 13, 0)),
 
227
                r.get_apparent_author)
 
228
        self.assertEqual('C', author)
213
229
 
214
230
    def test_get_apparent_authors(self):
215
231
        r = revision.Revision('1')
220
236
        r.properties['authors'] = 'C\nD'
221
237
        self.assertEqual(['C', 'D'], r.get_apparent_authors())
222
238
 
223
 
    def test_get_apparent_authors_no_committer(self):
224
 
        r = revision.Revision('1')
225
 
        self.assertEqual([], r.get_apparent_authors())
226
 
 
227
239
 
228
240
class TestRevisionBugs(TestCase):
229
241
    """Tests for getting the bugs that a revision is linked to."""