~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2007-06-26 20:32:49 UTC
  • mto: (2581.1.1 cleanup-runbzr)
  • mto: This revision was merged to the branch mainline in revision 2588.
  • Revision ID: v.ladeuil+lp@free.fr-20070626203249-sqm4afiai5dxofum
Deprecate the varargs syntax and fix the tests.

* bzrlib/tests/__init__.py:
(TestCase.run_bzr): Activate the deprecation warning.
(TestCase.run_bzr_error): Add error_regexes to kwargs or run_bzr
get confused.

* bzrlib/tests/blackbox/test_selftest.py:
(TestRunBzr.test_args): Activate.

* bzrlib/tests/blackbox/test_inventory.py:
(TestInventory.assertInventoryEqual): Build the command from args
if not None.

* bzrlib/tests/blackbox/test_ls.py:
(TestLS.ls_equals): Build the command from args if not None.

* bzrlib/tests/blackbox/test_remove_tree.py:
(TestRemoveTree.test_remove_tree_lightweight_checkout_explicit):
Nice catch, we were calling run_bzr instead of run_bzr_error. This
went unnoticed for some time...

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 
53
53
    def test_uses_submit(self):
54
54
        """Submit location can be used and set"""
55
 
        self.make_trees()        
 
55
        self.make_trees()
56
56
        os.chdir('branch')
57
57
        br = read_bundle(StringIO(self.run_bzr('bundle')[0]))
58
58
        self.assertRevisions(br, ['revision3'])
59
 
        br = read_bundle(StringIO(self.run_bzr('bundle', '../grandparent')[0]))
 
59
        br = read_bundle(StringIO(self.run_bzr('bundle ../grandparent')[0]))
60
60
        self.assertRevisions(br, ['revision3', 'revision2'])
61
61
        # submit location should be auto-remembered
62
62
        br = read_bundle(StringIO(self.run_bzr('bundle')[0]))
63
63
        self.assertRevisions(br, ['revision3', 'revision2'])
64
 
        self.run_bzr('bundle', '../parent')
 
64
        self.run_bzr('bundle ../parent')
65
65
        br = read_bundle(StringIO(self.run_bzr('bundle')[0]))
66
66
        self.assertRevisions(br, ['revision3', 'revision2'])
67
 
        self.run_bzr('bundle', '../parent', '--remember')
 
67
        self.run_bzr('bundle ../parent --remember')
68
68
        br = read_bundle(StringIO(self.run_bzr('bundle')[0]))
69
69
        self.assertRevisions(br, ['revision3'])
70
 
        err = self.run_bzr('bundle', '--remember', retcode=3)[1]
71
 
        self.assertContainsRe(err, 
 
70
        err = self.run_bzr('bundle --remember', retcode=3)[1]
 
71
        self.assertContainsRe(err,
72
72
                              '--remember requires a branch to be specified.')
73
73
 
74
74
    def test_revision_branch_interaction(self):
75
 
        self.make_trees()        
 
75
        self.make_trees()
76
76
        os.chdir('branch')
77
 
        bi = read_bundle(StringIO(self.run_bzr('bundle', '../grandparent')[0]))
 
77
        bi = read_bundle(StringIO(self.run_bzr('bundle ../grandparent')[0]))
78
78
        self.assertRevisions(bi, ['revision3', 'revision2'])
79
 
        out = StringIO(self.run_bzr('bundle', '../grandparent', '-r', '-2')[0])
 
79
        out = StringIO(self.run_bzr('bundle ../grandparent -r -2')[0])
80
80
        bi = read_bundle(out)
81
81
        self.assertRevisions(bi, ['revision2'])
82
 
        bi = read_bundle(StringIO(self.run_bzr('bundle', '-r', '-2..-1')[0]))
 
82
        bi = read_bundle(StringIO(self.run_bzr('bundle -r -2..-1')[0]))
83
83
        self.assertRevisions(bi, ['revision3'])
84
 
        self.run_bzr('bundle', '../grandparent', '-r', '-2..-1', retcode=3)
 
84
        self.run_bzr('bundle ../grandparent -r -2..-1', retcode=3)
85
85
 
86
86
    def test_output(self):
87
87
        # check output for consistency
88
88
        # win32 stdout converts LF to CRLF,
89
89
        # and this is breaks the created bundle
90
 
        self.make_trees()        
 
90
        self.make_trees()
91
91
        os.chdir('branch')
92
92
        stdout = self.run_bzr_subprocess('bundle')[0]
93
93
        br = read_bundle(StringIO(stdout))
97
97
        foo = self.make_branch_and_tree('foo')
98
98
        bar = self.make_branch_and_tree('bar')
99
99
        os.chdir('foo')
100
 
        self.run_bzr('bundle', '../bar')
 
100
        self.run_bzr('bundle ../bar')