Skip to content

Commit f1afb7f

Browse files
committed
Declared static methods
1 parent fa23062 commit f1afb7f

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

test/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def assertURLEqual(self, first, second, msg=None):
5050
second_qsl = sorted(parse_qsl(second_parsed.query))
5151
self.assertEqual(first_qsl, second_qsl, msg)
5252

53-
def u(self, string):
53+
@staticmethod
54+
def u(string):
5455
"""Create a unicode string, compatible across all versions of Python."""
5556
# NOTE(cbro): Python 3-3.2 does not have the u'' syntax.
5657
return codecs.unicode_escape_decode(string)[0]

test/test_validator.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525
class ValidatorTest(_test.TestCase):
2626

27-
def test_directions_correct_schema(self):
27+
@staticmethod
28+
def test_directions_correct_schema():
2829
validator.validator(ENDPOINT_DICT['directions'], 'directions')
2930

3031
def test_directions_wrong_schema(self):
@@ -40,7 +41,8 @@ def test_directions_wrong_schema(self):
4041
self.assertIn('unknown field', str(em))
4142
self.assertIn('max length is 2', str(em))
4243

43-
def test_isochrones_correct_schema(self):
44+
@staticmethod
45+
def test_isochrones_correct_schema():
4446
validator.validator(ENDPOINT_DICT['isochrones'], 'isochrones')
4547

4648
def test_isochrones_wrong_schema(self):
@@ -58,7 +60,8 @@ def test_isochrones_wrong_schema(self):
5860
self.assertIn('unallowed value', str(em))
5961
self.assertIn('must be of integer type', str(em))
6062

61-
def test_distance_matrix_correct_schema(self):
63+
@staticmethod
64+
def test_distance_matrix_correct_schema():
6265
validator.validator(ENDPOINT_DICT['distance_matrix'], 'distance_matrix')
6366

6467
def test_distance_matrix_wrong_schema(self):
@@ -77,7 +80,8 @@ def test_distance_matrix_wrong_schema(self):
7780
self.assertIn('max value is 1', str(em))
7881
self.assertIn('unknown field', str(em))
7982

80-
def test_search_correct_schema(self):
83+
@staticmethod
84+
def test_search_correct_schema():
8185
validator.validator(ENDPOINT_DICT['pelias_search'], 'pelias_search')
8286

8387
def test_search_wrong_schema(self):
@@ -93,7 +97,8 @@ def test_search_wrong_schema(self):
9397
self.assertIn("unallowed values ['name']", str(em))
9498
self.assertIn('must be of integer type', str(em))
9599

96-
def test_autocomplete_correct_schema(self):
100+
@staticmethod
101+
def test_autocomplete_correct_schema():
97102
validator.validator(ENDPOINT_DICT['pelias_autocomplete'], 'pelias_autocomplete')
98103

99104
def test_autocomplete_wrong_schema(self):
@@ -107,7 +112,8 @@ def test_autocomplete_wrong_schema(self):
107112

108113
self.assertIn("unallowed values ['name']", str(em))
109114

110-
def test_structured_correct_schema(self):
115+
@staticmethod
116+
def test_structured_correct_schema():
111117
validator.validator(ENDPOINT_DICT['pelias_structured'], 'pelias_structured')
112118

113119
def test_structured_wrong_schema(self):
@@ -133,7 +139,8 @@ def test_structured_wrong_schema(self):
133139
self.assertIn('must be of integer type', str(em))
134140
self.assertIn('must be of string type', str(em))
135141

136-
def test_reverse_correct_schema(self):
142+
@staticmethod
143+
def test_reverse_correct_schema():
137144
validator.validator(ENDPOINT_DICT['pelias_reverse'], 'pelias_reverse')
138145

139146
def test_reverse_wrong_schema(self):
@@ -149,7 +156,8 @@ def test_reverse_wrong_schema(self):
149156
self.assertIn('must be of string type', str(em))
150157
self.assertIn("unallowed values ['gm']", str(em))
151158

152-
def test_pois_correct_schema(self):
159+
@staticmethod
160+
def test_pois_correct_schema():
153161
validator.validator(ENDPOINT_DICT['pois'], 'pois')
154162

155163
ENDPOINT_DICT['pois']['geojson'] = PARAM_GEOJSON_LINE

0 commit comments

Comments
 (0)