~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_version_info.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-22 15:19:55 UTC
  • mto: This revision was merged to the branch mainline in revision 2032.
  • Revision ID: john@arbash-meinel.com-20060922151955-1ce5162055c9538d
Add a test that we can find the version info when we only have a branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    def test_invalid_format(self):
27
27
        self.run_bzr('version-info', '--format', 'quijibo', retcode=3)
28
28
 
29
 
    def create_branch(self):
 
29
    def create_tree(self):
30
30
        wt = self.make_branch_and_tree('branch')
31
31
 
32
32
        self.build_tree(['branch/a'])
38
38
        wt.commit('adding b', rev_id='r2')
39
39
 
40
40
        self.revisions = wt.branch.revision_history()
 
41
        return wt
41
42
 
42
43
    def test_basic(self):
43
 
        self.create_branch()
 
44
        self.create_tree()
44
45
 
45
46
        txt = self.run_bzr('version-info', 'branch')[0]
46
47
        self.assertContainsRe(txt, 'date:')
50
51
 
51
52
    def test_all(self):
52
53
        """'--all' includes clean, revision history, and file revisions"""
53
 
        self.create_branch()
 
54
        self.create_tree()
54
55
        txt = self.run_bzr('version-info', 'branch',
55
56
                           '--all')[0]
56
57
        self.assertContainsRe(txt, 'date:')
68
69
 
69
70
    def test_clean(self):
70
71
        """Test that --check-clean includes the right info"""
71
 
        self.create_branch()
 
72
        self.create_tree()
72
73
 
73
74
        txt = self.run_bzr('version-info', 'branch',
74
75
                           '--check-clean')[0]
85
86
 
86
87
        os.remove('branch/c')
87
88
 
 
89
    def test_no_working_tree(self):
 
90
        tree = self.create_tree()
 
91
        branch = self.make_branch('just_branch')
 
92
        branch.pull(tree.branch)
 
93
 
 
94
        txt = self.run_bzr('version-info', 'just_branch')[0]
 
95
        self.assertStartsWith(txt, 'revision-id: r2\n')
 
96
 
88
97
    def assertEqualNoBuildDate(self, text1, text2):
89
98
        """Compare 2 texts, but ignore the build-date field.
90
99
 
103
112
 
104
113
    def test_no_branch(self):
105
114
        """Test that bzr defaults to the local working directory"""
106
 
        self.create_branch()
 
115
        self.create_tree()
107
116
 
108
117
        txt1 = self.run_bzr('version-info', 'branch')[0]
109
118
 
113
122
 
114
123
    def test_rio(self):
115
124
        """Test that we can pass --format=rio"""
116
 
        self.create_branch()
 
125
        self.create_tree()
117
126
 
118
127
        txt = self.run_bzr('version-info', 'branch')[0]
119
128
        txt1 = self.run_bzr('version-info', '--format', 'rio', 'branch')[0]
123
132
 
124
133
    def test_python(self):
125
134
        """Test that we can do --format=python"""
126
 
        self.create_branch()
 
135
        self.create_tree()
127
136
 
128
137
        txt = self.run_bzr('version-info', '--format', 'python', 'branch')[0]
129
138