~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge_directive.py

  • Committer: Aaron Bentley
  • Date: 2007-02-28 22:58:45 UTC
  • mto: (2323.6.9 0.15-integration)
  • mto: This revision was merged to the branch mainline in revision 2330.
  • Revision ID: abentley@panoramicfeedback.com-20070228225845-01l214kd4xeb681q
Add timestamps to merge directives

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
class TestMergeDirective(tests.TestCase):
8
8
 
9
9
    def test_init(self):
10
 
        self.assertRaises(errors.NoMergeSource, merge_directive.MergeDirective,
11
 
            'example:', 'sha', 'http://example.com')
12
 
        self.assertRaises(errors.NoMergeSource, merge_directive.MergeDirective,
13
 
            'example:', 'sha', 'http://example.com', patch_type='diff')
14
 
        md = merge_directive.MergeDirective('example:', 'sha',
 
10
        time = 500.0
 
11
        timezone = 5
 
12
        self.assertRaises(errors.NoMergeSource, merge_directive.MergeDirective,
 
13
            'example:', 'sha', time, timezone, 'http://example.com')
 
14
        self.assertRaises(errors.NoMergeSource, merge_directive.MergeDirective,
 
15
            'example:', 'sha', time, timezone, 'http://example.com',
 
16
            patch_type='diff')
 
17
        md = merge_directive.MergeDirective('example:', 'sha', time, timezone,
15
18
            'http://example.com', public_location='http://example.org')
16
19
        self.assertRaises(errors.PatchMissing, merge_directive.MergeDirective,
17
 
            'example:', 'sha', 'http://example.com', patch_type='bundle')
18
 
        md = merge_directive.MergeDirective('null:', 'sha',
 
20
            'example:', 'sha', time, timezone, 'http://example.com',
 
21
            patch_type='bundle')
 
22
        md = merge_directive.MergeDirective('null:', 'sha', time, timezone,
19
23
            'http://example.com', patch='blah', patch_type='bundle')
20
24
        self.assertRaises(errors.PatchMissing, merge_directive.MergeDirective,
21
 
            'example:', 'http://example.com', 'sha',
 
25
            'example:', 'http://example.com', 'sha', time, timezone,
22
26
            public_location="http://example.org", patch_type='diff')
23
 
        md = merge_directive.MergeDirective('example:',
24
 
            'sha1', 'http://example.com', public_location="http://example.org",
 
27
        md = merge_directive.MergeDirective('example:', 'sha1', time, timezone,
 
28
            'http://example.com', public_location="http://example.org",
25
29
            patch='', patch_type='diff')
26
30
 
27
31
    def test_serialization(self):
28
 
        md = merge_directive.MergeDirective('example:', 'sha',
 
32
        time = 500.23
 
33
        timezone = 60
 
34
        md = merge_directive.MergeDirective('example:', 'sha', time, timezone,
29
35
            'http://example.com', public_location="http://example.org",
30
36
            patch='booga', patch_type='diff')
31
37
        md2 = merge_directive.MergeDirective.from_lines(md.to_lines())
33
39
        self.assertEqual('sha', md2.testament_sha1)
34
40
        self.assertEqual('http://example.com', md2.submit_location)
35
41
        self.assertEqual('http://example.org', md2.public_location)
 
42
        self.assertEqual(time, md2.time)
 
43
        self.assertEqual(timezone, md2.timezone)
36
44
        self.assertEqual('diff', md2.patch_type)
37
45
        self.assertEqual('booga', md2.patch)
38
46
        md.patch = "# Bazaar revision bundle v0.9\n#\n"