~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_nonascii.py

Move working tree initialisation out from  Branch.initialize, deprecated Branch.initialize to Branch.create.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
21
 
from bzrlib.tests import TestCaseInTempDir
22
 
from bzrlib.branch import Branch
23
 
 
24
 
 
25
 
class NonAsciiTest(TestCaseInTempDir):
 
21
from bzrlib.osutils import pathjoin
 
22
from bzrlib.tests import TestCaseWithTransport, TestSkipped
 
23
from bzrlib.workingtree import WorkingTree
 
24
 
 
25
 
 
26
class NonAsciiTest(TestCaseWithTransport):
26
27
 
27
28
    def test_add_in_nonascii_branch(self):
28
29
        """Test adding in a non-ASCII branch."""
29
30
        br_dir = u"\u1234"
30
31
        try:
31
 
            os.mkdir(br_dir)
32
 
            os.chdir(br_dir)
 
32
            wt = self.make_branch_and_tree(br_dir)
33
33
        except UnicodeEncodeError:
34
 
            self.log("filesystem can't accomodate nonascii names")
 
34
            raise TestSkipped("filesystem can't accomodate nonascii names")
35
35
            return
36
 
        br = Branch.initialize(u".")
37
 
        file("a", "w").write("hello")
38
 
        br.working_tree().add(["a"], ["a-id"])
 
36
        file(pathjoin(br_dir, "a"), "w").write("hello")
 
37
        wt.add(["a"], ["a-id"])