~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(gz) Cleanup and test selftest thread leak detection (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
class TestViewUI(TestCaseWithTransport):
25
25
 
 
26
    def make_branch_and_tree(self):
 
27
        # we need to use a specific format because the default format
 
28
        # doesn't support views yet
 
29
        format = bzrdir.format_registry.make_bzrdir('development6-rich-root')
 
30
        return TestCaseWithTransport.make_branch_and_tree(self, '.',
 
31
            format=format)
 
32
 
26
33
    def test_view_command_help(self):
27
34
        out, err = self.run_bzr('help view')
28
35
        self.assertContainsRe(out, 'Manage filtered views')
29
36
 
30
37
    def test_define_view(self):
31
 
        wt = self.make_branch_and_tree('.')
 
38
        wt = self.make_branch_and_tree()
32
39
        # Check definition of a new view
33
40
        out, err = self.run_bzr('view a b c')
34
41
        self.assertEquals(out, "Using 'my' view: a, b, c\n")
44
51
        self.assertContainsRe(err, "Cannot change the 'off' pseudo view")
45
52
 
46
53
    def test_list_view(self):
47
 
        wt = self.make_branch_and_tree('.')
 
54
        wt = self.make_branch_and_tree()
48
55
        # Check list of the current view
49
56
        out, err = self.run_bzr('view')
50
57
        self.assertEquals(out, "No current view.\n")
69
76
        self.assertContainsRe(err, "No such view")
70
77
 
71
78
    def test_delete_view(self):
72
 
        wt = self.make_branch_and_tree('.')
 
79
        wt = self.make_branch_and_tree()
73
80
        # Check delete of the current view
74
81
        out, err = self.run_bzr('view --delete', retcode=3)
75
82
        self.assertContainsRe(err, "No current view to delete")
94
101
        self.assertContainsRe(err, "Both --delete and a file list specified")
95
102
 
96
103
    def test_switch_view(self):
97
 
        wt = self.make_branch_and_tree('.')
 
104
        wt = self.make_branch_and_tree()
98
105
        # Check switching to a named view
99
106
        self.run_bzr('view a b c')
100
107
        self.run_bzr('view e f --name foo')