Skip to content

Commit 70d18ea

Browse files
committed
Do not use u'' unicode prefix
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent d497a4c commit 70d18ea

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/test_gen.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@
3535
class GenTest(unittest.TestCase):
3636
def test_check_duplicated_columns(self):
3737
test_file = get_test_loc('test_gen/dup_keys.csv')
38-
expected = [Error(ERROR, u'Duplicated column name(s): copyright with copyright\nPlease correct the input and re-run.')]
38+
expected = [Error(ERROR, 'Duplicated column name(s): copyright with copyright\nPlease correct the input and re-run.')]
3939
result = gen.check_duplicated_columns(test_file)
4040
assert expected == result
4141

4242
def test_check_duplicated_columns_handles_lower_upper_case(self):
4343
test_file = get_test_loc('test_gen/dup_keys_with_diff_case.csv')
44-
expected = [Error(ERROR, u'Duplicated column name(s): copyright with Copyright\nPlease correct the input and re-run.')]
44+
expected = [Error(ERROR, 'Duplicated column name(s): copyright with Copyright\nPlease correct the input and re-run.')]
4545
result = gen.check_duplicated_columns(test_file)
4646
assert expected == result
4747

4848
def test_check_duplicated_about_file_path(self):
4949
test_dict = [
50-
{'about_file_path': u'/test/test.c', u'version': u'1.03', u'name': u'test.c'},
51-
{'about_file_path': u'/test/abc/', u'version': u'1.0', u'name': u'abc'},
52-
{'about_file_path': u'/test/test.c', u'version': u'1.04', u'name': u'test1.c'}]
53-
expected = [Error(CRITICAL, u'The input has duplicated values in \'about_file_path\' field: /test/test.c')]
50+
{'about_file_path': '/test/test.c', 'version': '1.03', 'name': 'test.c'},
51+
{'about_file_path': '/test/abc/', 'version': '1.0', 'name': 'abc'},
52+
{'about_file_path': '/test/test.c', 'version': '1.04', 'name': 'test1.c'}]
53+
expected = [Error(CRITICAL, 'The input has duplicated values in \'about_file_path\' field: /test/test.c')]
5454
result = gen.check_duplicated_about_file_path(test_dict)
5555
assert expected == result
5656

@@ -122,7 +122,7 @@ def test_generation_with_no_about_resource(self):
122122
location = get_test_loc('test_gen/inv2.csv')
123123
base_dir = get_temp_dir()
124124
errors, abouts = gen.generate(location, base_dir)
125-
expected = OrderedDict([(u'.', None)])
125+
expected = OrderedDict([('.', None)])
126126
assert abouts[0].about_resource.value == expected
127127
assert len(errors) == 1
128128

@@ -131,19 +131,19 @@ def test_generation_with_no_about_resource_reference(self):
131131
base_dir = get_temp_dir()
132132

133133
errors, abouts = gen.generate(location, base_dir)
134-
expected = OrderedDict([(u'test.tar.gz', None)])
134+
expected = OrderedDict([('test.tar.gz', None)])
135135

136136
assert abouts[0].about_resource.value == expected
137137
assert len(errors) == 1
138-
msg = u'Field about_resource'
138+
msg = 'Field about_resource'
139139
assert msg in errors[0].message
140140

141141
def test_generation_with_no_about_resource_reference_no_resource_validation(self):
142142
location = get_test_loc('test_gen/inv3.csv')
143143
base_dir = get_temp_dir()
144144

145145
errors, abouts = gen.generate(location, base_dir)
146-
expected = OrderedDict([(u'test.tar.gz', None)])
146+
expected = OrderedDict([('test.tar.gz', None)])
147147

148148
assert abouts[0].about_resource.value == expected
149149
assert len(errors) == 1
@@ -153,8 +153,8 @@ def test_generate(self):
153153
base_dir = get_temp_dir()
154154

155155
errors, abouts = gen.generate(location, base_dir)
156-
msg1 = u'Field custom1 is not a supported field and is ignored.'
157-
msg2 = u'Field about_resource'
156+
msg1 = 'Field custom1 is not a supported field and is ignored.'
157+
msg2 = 'Field about_resource'
158158

159159
assert msg1 in errors[0].message
160160
assert msg2 in errors[1].message

0 commit comments

Comments
 (0)