/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

  • Committer: Vincent Ladeuil
  • Date: 2010-03-02 15:49:51 UTC
  • mto: (5070.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5071.
  • Revision ID: v.ladeuil+lp@free.fr-20100302154951-svh2e2093u067udy
Keep only the relevant tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2009, 2010 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
31
31
 
32
32
class TestMkdir(TestCaseWithTransport):
33
33
 
34
 
    def test_mkdir_in_repo(self):
35
 
        """'mkdir' should fail cleanly withing a repo. Bug #138600"""
36
 
        shared_repo = self.make_repository('./foobar')
37
 
        self.run_bzr(['mkdir', 'foobar/abc'], retcode=3)
38
 
        self.failIfExists('foobar/abc')
39
 
 
40
 
    def test_mkdir_outside_unversioned_dir(self):
41
 
        """'mkdir' should fail with unversioned directory in path. Bug #138600"""
42
 
        dir = pathjoin('.', 'unversioned_dir0')
43
 
        newdir = pathjoin(dir, 'abc')
44
 
        os.mkdir(dir)
45
 
        self.run_bzr(['mkdir', newdir], retcode=3)
46
 
        self.failIfExists(newdir)
47
 
 
48
 
    def test_mkdir_inside_unversioned_dir(self):
49
 
        """'mkdir' should fail cleanly from within an unversioned directory. Bug #138600"""
50
 
        dir = pathjoin('.', 'unversioned_dir1')
51
 
        os.mkdir(dir)
52
 
        self.run_bzr(['mkdir', 'abc'], working_dir=dir, retcode=3)
53
 
        newdir = pathjoin(dir, 'abc')
54
 
        self.failIfExists(newdir)
55
 
 
56
 
    def test_mkdir_outside_unversioned_dir_within_branch(self):
57
 
        """'mkdir' should fail with unversioned directory inside branch. Bug #138600"""
58
 
        b = 'foobar0'
59
 
        self.make_branch_and_tree(b)
60
 
        os.chdir(b)
61
 
        dir = pathjoin('.', 'unversioned_dir0')
62
 
        newdir = pathjoin(dir, 'abc')
63
 
        os.mkdir(dir)
64
 
        self.run_bzr(['mkdir', newdir], retcode=3)
65
 
        self.failIfExists(newdir)
66
 
 
67
 
    def test_mkdir_inside_unversioned_dir_within_branch(self):
68
 
        """'mkdir' should fail cleanly from within an unversioned directory
69
 
        inside branch. Bug #138600"""
70
 
        b = 'foobar1'
71
 
        self.make_branch_and_tree(b)
72
 
        os.chdir(b)
73
 
        dir = pathjoin('.', 'unversioned_dir1')
74
 
        os.mkdir(dir)
75
 
        self.run_bzr(['mkdir', 'abc'], working_dir=dir, retcode=3)
76
 
        newdir = pathjoin(dir, 'abc')
77
 
        self.failIfExists(newdir)
 
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')
78
43
 
79
44
 
80
45
class TestVersioning(TestCaseInTempDir):