~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_add.py

[patch] use unicode literals for all hardcoded paths (Alexander Belchenko)

> When you use flat string on Windows for base part of file names then all
> derived file names is always representing as flat string. On Linux/Cygwin as
> I can see in situations when path cannot be represented as flat string (or in
> ascii encoding?) it silently converted to unicode. As result we have
> different behaviour with non-ascii (non-english) file names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
        from bzrlib.add import smart_add
15
15
        paths = ("original/", "original/file1", "original/file2")
16
16
        self.build_tree(paths)
17
 
        branch = Branch.initialize(".")
18
 
        smart_add((".",), recurse=True)
 
17
        branch = Branch.initialize(u".")
 
18
        smart_add((u".",), recurse=True)
19
19
        for path in paths:
20
20
            self.assertNotEqual(branch.working_tree().path2id(path), None)
21
21
 
24
24
        from bzrlib.add import smart_add
25
25
        paths = ("original/", "original/file1", "original/file2")
26
26
        self.build_tree(paths)
27
 
        branch = Branch.initialize(".")
 
27
        branch = Branch.initialize(u".")
28
28
        os.chdir("original")
29
 
        smart_add((".",), recurse=True)
 
29
        smart_add((u".",), recurse=True)
30
30
        for path in paths:
31
31
            self.assertNotEqual(branch.working_tree().path2id(path), None)
32
32
 
53
53
                       "original/child/", "original/child/path")
54
54
        
55
55
        self.build_tree(build_paths)
56
 
        branch = Branch.initialize(".")
 
56
        branch = Branch.initialize(u".")
57
57
        child_branch = Branch.initialize("original/child")
58
 
        smart_add((".",), True, add_reporter_null)
 
58
        smart_add((u".",), True, add_reporter_null)
59
59
        for path in paths:
60
60
            self.assertNotEqual((path, branch.working_tree().path2id(path)),
61
61
                                (path, None))
70
70
        from bzrlib.add import smart_add
71
71
        paths = ("file1", "file2")
72
72
        self.build_tree(paths)
73
 
        branch = Branch.initialize(".")
 
73
        branch = Branch.initialize(u".")
74
74
        smart_add(paths)
75
75
        for path in paths:
76
76
            self.assertNotEqual(branch.working_tree().path2id(path), None)
83
83
        from bzrlib.add import smart_add_tree
84
84
        paths = ("original/", "original/file1", "original/file2")
85
85
        self.build_tree(paths)
86
 
        Branch.initialize(".")
 
86
        Branch.initialize(u".")
87
87
        tree = WorkingTree()
88
 
        smart_add_tree(tree, (".",))
 
88
        smart_add_tree(tree, (u".",))
89
89
        for path in paths:
90
90
            self.assertNotEqual(tree.path2id(path), None)
91
91
 
94
94
        from bzrlib.add import smart_add_tree
95
95
        paths = ("original/", "original/file1", "original/file2")
96
96
        self.build_tree(paths)
97
 
        Branch.initialize(".")
 
97
        Branch.initialize(u".")
98
98
        tree = WorkingTree()
99
99
        os.chdir("original")
100
 
        smart_add_tree(tree, (".",))
 
100
        smart_add_tree(tree, (u".",))
101
101
        for path in paths:
102
102
            self.assertNotEqual(tree.path2id(path), None)
103
103
 
123
123
        build_paths = ("original/", "original/file1", "original/file2", 
124
124
                       "original/child/", "original/child/path")
125
125
        self.build_tree(build_paths)
126
 
        Branch.initialize(".")
 
126
        Branch.initialize(u".")
127
127
        tree = WorkingTree()
128
128
        child_branch = Branch.initialize("original/child")
129
 
        smart_add_tree(tree, (".",))
 
129
        smart_add_tree(tree, (u".",))
130
130
        for path in paths:
131
131
            self.assertNotEqual((path, tree.path2id(path)),
132
132
                                (path, None))
141
141
        from bzrlib.add import smart_add_tree
142
142
        paths = ("file1", "file2")
143
143
        self.build_tree(paths)
144
 
        Branch.initialize(".")
 
144
        Branch.initialize(u".")
145
145
        tree = WorkingTree()
146
146
        smart_add_tree(tree, paths)
147
147
        for path in paths: