/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 breezy/tests/test_nonascii.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 18:59:44 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116185944-biefv1sub37qfybm
Sprinkle some PEP8iness.

Merged from https://code.launchpad.net/~jelmer/brz/more-cleanups/+merge/358611

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        except UnicodeEncodeError:
36
36
            raise TestSkipped("filesystem can't accomodate nonascii names")
37
37
            return
38
 
        with open(pathjoin(br_dir, "a"), "w") as f: f.write("hello")
 
38
        with open(pathjoin(br_dir, "a"), "w") as f:
 
39
            f.write("hello")
39
40
        wt.add(["a"], [b"a-id"])
40
41
 
41
42
 
45
46
a_dots_d = u'a\u0308'
46
47
z_umlat_c = u'\u017d'
47
48
z_umlat_d = u'Z\u030c'
48
 
squared_c = u'\xbc' # This gets mapped to '2' if we use NFK[CD]
 
49
squared_c = u'\xbc'  # This gets mapped to '2' if we use NFK[CD]
49
50
squared_d = u'\xbc'
50
 
quarter_c = u'\xb2' # Gets mapped to u'1\u20444' (1/4) if we use NFK[CD]
 
51
quarter_c = u'\xb2'  # Gets mapped to u'1\u20444' (1/4) if we use NFK[CD]
51
52
quarter_d = u'\xb2'
52
53
 
53
54
 
115
116
        # a_circle_c and a_dots_c actually map to the same file
116
117
        # adding a suffix kicks in the 'preserving but insensitive'
117
118
        # route, and maintains the right files
118
 
        files = [a_circle_c+'.1', a_dots_c+'.2', z_umlat_c+'.3']
 
119
        files = [a_circle_c + '.1', a_dots_c + '.2', z_umlat_c + '.3']
119
120
        try:
120
121
            self.build_tree(files)
121
122
        except UnicodeError:
122
123
            raise TestSkipped("filesystem cannot create unicode files")
123
124
 
124
125
        if sys.platform == 'darwin':
125
 
            expected = sorted([a_circle_d+'.1', a_dots_d+'.2', z_umlat_d+'.3'])
 
126
            expected = sorted(
 
127
                [a_circle_d + '.1', a_dots_d + '.2', z_umlat_d + '.3'])
126
128
        else:
127
129
            expected = sorted(files)
128
130
 
136
138
        # a_circle_c and a_dots_c actually map to the same file
137
139
        # adding a suffix kicks in the 'preserving but insensitive'
138
140
        # route, and maintains the right files
139
 
        files = [a_circle_c+'.1', a_dots_c+'.2', z_umlat_c+'.3',
140
 
                 squared_c+'.4', quarter_c+'.5']
 
141
        files = [a_circle_c + '.1', a_dots_c + '.2', z_umlat_c + '.3',
 
142
                 squared_c + '.4', quarter_c + '.5']
141
143
        try:
142
144
            self.build_tree(files, line_endings='native')
143
145
        except UnicodeError:
163
165
    def test_access_non_normalized(self):
164
166
        # Sometimes we can access non-normalized files by their normalized
165
167
        # path, verify that normalized_filename returns the right info
166
 
        files = [a_circle_d+'.1', a_dots_d+'.2', z_umlat_d+'.3']
 
168
        files = [a_circle_d + '.1', a_dots_d + '.2', z_umlat_d + '.3']
167
169
 
168
170
        try:
169
171
            self.build_tree(files)