/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_testament.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-16 16:27:58 UTC
  • mto: This revision was merged to the branch mainline in revision 1938.
  • Revision ID: john@arbash-meinel.com-20060816162758-752ad5818bc063c9
Move out the blackbox testament tests into a real blackbox module

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import os
22
22
from sha import sha
23
 
import sys
24
23
 
25
24
from bzrlib.tests import TestCaseWithTransport
26
 
from bzrlib.branch import Branch
27
25
from bzrlib.testament import Testament, StrictTestament
28
 
from bzrlib.trace import mutter
29
26
from bzrlib.transform import TreeTransform
30
27
from bzrlib.osutils import has_symlinks
31
28
 
32
29
 
33
 
class TestamentTests(TestCaseWithTransport):
 
30
class TestamentSetup(TestCaseWithTransport):
34
31
 
35
32
    def setUp(self):
36
 
        super(TestamentTests, self).setUp()
 
33
        super(TestamentSetup, self).setUp()
37
34
        self.wt = self.make_branch_and_tree('.')
38
35
        b = self.b = self.wt.branch
39
36
        b.nick = "test branch"
57
54
                 rev_id='test@user-2',
58
55
                 committer='test@user')
59
56
 
 
57
 
 
58
class TestamentTests(TestamentSetup):
 
59
 
60
60
    def test_null_testament(self):
61
61
        """Testament for a revision with no contents."""
62
62
        t = Testament.from_revision(self.b.repository, 'test@user-1')
100
100
        actual_short = t.as_short_text()
101
101
        self.assertEqualDiff(actual_short, REV_2_SHORT_STRICT)
102
102
 
103
 
    def test_testament_command(self):
104
 
        """Testament containing a file and a directory."""
105
 
        out, err = self.run_bzr_captured(['testament', '--long'])
106
 
        self.assertEqualDiff(err, '')
107
 
        self.assertEqualDiff(out, REV_2_TESTAMENT)
108
 
 
109
 
    def test_testament_command_2(self):
110
 
        """Command getting short testament of previous version."""
111
 
        out, err = self.run_bzr_captured(['testament', '-r1'])
112
 
        self.assertEqualDiff(err, '')
113
 
        self.assertEqualDiff(out, REV_1_SHORT)
114
 
 
115
 
    def test_testament_command_3(self):
116
 
        """Command getting short testament of previous version."""
117
 
        out, err = self.run_bzr_captured(['testament', '-r1', '--strict'])
118
 
        self.assertEqualDiff(err, '')
119
 
        self.assertEqualDiff(out, REV_1_SHORT_STRICT)
120
 
 
121
103
    def test_testament_symlinks(self):
122
104
        """Testament containing symlink (where possible)"""
123
105
        if not has_symlinks():