/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/blackbox/test_versioning.py

Rework test_script a little bit.


Don't allow someone to request a stdin request to echo.
Echo never reads from stdin, it just echos its arguments.
You use 'cat' if you want to read from stdin.

A few other fixes because the tests were using filenames
that are actually illegal on Windows, rather than just
nonexistant.


Change the exception handling for commands so that
unknown errors don't get silently squashed and then
turn into hard-to-debug errors later.

test_script now passes on Windows.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2005 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
29
29
from bzrlib.workingtree import WorkingTree
30
30
 
31
31
 
32
 
class TestMkdir(TestCaseWithTransport):
33
 
 
34
 
    def test_mkdir_fails_cleanly(self):
35
 
        """'mkdir' fails cleanly when no working tree is available.
36
 
        https://bugs.edge.launchpad.net/bzr/+bug/138600
37
 
        """
38
 
        # Since there is a safety working tree above us, we create a bare repo
39
 
        # here locally.
40
 
        shared_repo = self.make_repository('.')
41
 
        self.run_bzr(['mkdir', 'abc'], retcode=3)
42
 
        self.failIfExists('abc')
43
 
 
44
 
 
45
32
class TestVersioning(TestCaseInTempDir):
46
33
 
47
34
    def test_mkdir(self):
48
35
        """Basic 'bzr mkdir' operation"""
49
36
 
50
37
        self.run_bzr('init')
51
 
        self.run_bzr(['mkdir', 'foo'])
 
38
        self.run_bzr('mkdir foo')
52
39
        self.assert_(os.path.isdir('foo'))
53
40
 
54
 
        self.run_bzr(['mkdir', 'foo'], retcode=3)
 
41
        self.run_bzr('mkdir foo', retcode=3)
55
42
 
56
43
        wt = WorkingTree.open('.')
57
44
 
67
54
        """'bzr mkdir' operation in subdirectory"""
68
55
 
69
56
        self.run_bzr('init')
70
 
        self.run_bzr(['mkdir', 'dir'])
 
57
        self.run_bzr('mkdir dir')
71
58
        self.assert_(os.path.isdir('dir'))
72
59
 
73
60
        os.chdir('dir')
74
61
        self.log('Run mkdir in subdir')
75
 
        self.run_bzr(['mkdir', 'subdir'])
 
62
        self.run_bzr('mkdir subdir')
76
63
        self.assert_(os.path.isdir('subdir'))
77
64
        os.chdir('..')
78
65
 
99
86
        self.run_bzr('init')
100
87
        os.chdir('../..')
101
88
 
102
 
        self.run_bzr(['mkdir', 'dir', 'a/dir', 'a/b/dir'])
 
89
        self.run_bzr('mkdir dir a/dir a/b/dir')
103
90
        self.failUnless(os.path.isdir('dir'))
104
91
        self.failUnless(os.path.isdir('a/dir'))
105
92
        self.failUnless(os.path.isdir('a/b/dir'))