/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
2052.3.1 by John Arbash Meinel
Add tests to cleanup the copyright of all source files
1
# Copyright (C) 2006 Canonical Ltd
1986.1.2 by Robert Collins
Various changes to allow non-workingtree specific tests to run entirely
2
# Authors:  Robert Collins <robert.collins@canonical.com>
3
#
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
4183.7.1 by Sabin Iacob
update FSF mailing address
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1986.1.2 by Robert Collins
Various changes to allow non-workingtree specific tests to run entirely
17
18
"""Tests for interface conformance of 'workingtree.put_mkdir'"""
19
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
20
from breezy.tests.per_workingtree import TestCaseWithWorkingTree
1986.1.2 by Robert Collins
Various changes to allow non-workingtree specific tests to run entirely
21
6851.1.1 by Jelmer Vernooij
More foreign branch fixes.
22
from breezy.workingtree import SettingFileIdUnsupported
23
1986.1.2 by Robert Collins
Various changes to allow non-workingtree specific tests to run entirely
24
25
class TestMkdir(TestCaseWithWorkingTree):
26
27
    def test_mkdir_no_id(self):
28
        t = self.make_branch_and_tree('t1')
4100.2.2 by Aaron Bentley
Remove locking decorator
29
        t.lock_write()
30
        self.addCleanup(t.unlock)
1986.1.2 by Robert Collins
Various changes to allow non-workingtree specific tests to run entirely
31
        file_id = t.mkdir('path')
7141.7.1 by Jelmer Vernooij
Get rid of file_ids in most of Tree.
32
        self.assertEqual('directory', t.kind('path'))
1986.1.2 by Robert Collins
Various changes to allow non-workingtree specific tests to run entirely
33
34
    def test_mkdir_with_id(self):
35
        t = self.make_branch_and_tree('t1')
4100.2.2 by Aaron Bentley
Remove locking decorator
36
        t.lock_write()
37
        self.addCleanup(t.unlock)
6851.1.1 by Jelmer Vernooij
More foreign branch fixes.
38
        if not t.supports_setting_file_ids():
39
            self.assertRaises(
40
                SettingFileIdUnsupported,
6973.13.2 by Jelmer Vernooij
Fix some more tests.
41
                t.mkdir, 'path', b'my-id')
6851.1.1 by Jelmer Vernooij
More foreign branch fixes.
42
        else:
6973.13.2 by Jelmer Vernooij
Fix some more tests.
43
            file_id = t.mkdir('path', b'my-id')
44
            self.assertEqual(b'my-id', file_id)
7141.7.1 by Jelmer Vernooij
Get rid of file_ids in most of Tree.
45
            self.assertEqual('directory', t.kind('path'))