~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_workingtree.py

merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2011 Canonical Ltd
2
2
# Authors:  Robert Collins <robert.collins@canonical.com>
3
3
#           and others
4
4
#
19
19
from cStringIO import StringIO
20
20
import errno
21
21
import os
22
 
import sys
23
22
 
24
23
from bzrlib import (
25
24
    branch,
29
28
    osutils,
30
29
    tests,
31
30
    urlutils,
32
 
    workingtree,
33
 
    )
34
 
from bzrlib.errors import (NotBranchError, NotVersionedError,
35
 
                           UnsupportedOperation, PathsNotVersionedError)
 
31
    )
 
32
from bzrlib.errors import (
 
33
    UnsupportedOperation,
 
34
    PathsNotVersionedError,
 
35
    )
36
36
from bzrlib.inventory import Inventory
37
37
from bzrlib.osutils import pathjoin, getcwd, has_symlinks
38
38
from bzrlib.tests import TestSkipped, TestNotApplicable
39
39
from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
40
 
from bzrlib.trace import mutter
41
 
from bzrlib.workingtree import (TreeEntry, TreeDirectory, TreeFile, TreeLink,
42
 
                                WorkingTree, WorkingTree2)
 
40
from bzrlib.workingtree import (
 
41
    TreeDirectory,
 
42
    TreeFile,
 
43
    TreeLink,
 
44
    WorkingTree,
 
45
    )
43
46
from bzrlib.conflicts import ConflictList, TextConflict, ContentsConflict
44
47
 
45
48
 
46
49
class TestWorkingTree(TestCaseWithWorkingTree):
47
50
 
 
51
    def test_branch_builder(self):
 
52
        # Just a smoke test that we get a branch at the specified relpath
 
53
        builder = self.make_branch_builder('foobar')
 
54
        br = branch.Branch.open('foobar')
 
55
 
48
56
    def test_list_files(self):
49
57
        tree = self.make_branch_and_tree('.')
50
58
        self.build_tree(['dir/', 'file'])
915
923
        else:
916
924
            case_sensitive = True
917
925
        tree = self.make_branch_and_tree('test')
918
 
        if tree.__class__ == WorkingTree2:
919
 
            raise TestSkipped('WorkingTree2 is not supported')
920
926
        self.assertEqual(case_sensitive, tree.case_sensitive)
 
927
        # now we cheat, and make a file that matches the case-sensitive name
 
928
        t = tree.bzrdir.get_workingtree_transport(None)
 
929
        try:
 
930
            content = tree._format.get_format_string()
 
931
        except NotImplementedError:
 
932
            # All-in-one formats didn't have a separate format string.
 
933
            content = tree.bzrdir._format.get_format_string()
 
934
        t.put_bytes(tree._format.case_sensitive_filename, content)
 
935
        tree = tree.bzrdir.open_workingtree()
 
936
        self.assertFalse(tree.case_sensitive)
921
937
 
922
938
    def test_all_file_ids_with_missing(self):
923
939
        tree = self.make_branch_and_tree('tree')