BigW Consortium Gitlab

Commit f1ba36ee by Dan McKinley

Merge pull request #2 from msabramo/master

Allow passing parameters of type long when an int is expected.
parents 415e202d 871cde8a
...@@ -62,6 +62,8 @@ class TypeChecker(object): ...@@ -62,6 +62,8 @@ class TypeChecker(object):
def check_int(self, value): def check_int(self, value):
if isinstance(value, long):
return True, value
return isinstance(value, int), value return isinstance(value, int), value
......
...@@ -157,6 +157,11 @@ class CoreTests(Test): ...@@ -157,6 +157,11 @@ class CoreTests(Test):
self.assertEqual(self.last_query()['limit'], ['5']) self.assertEqual(self.last_query()['limit'], ['5'])
def test_parameter_type_long(self):
self.api.testMethod(test_id=1L, limit=5L)
self.assertEqual(self.last_query()['limit'], ['5'])
def bad_value_msg(self, name, t, v): def bad_value_msg(self, name, t, v):
return "Bad value for parameter %s of type '%s' - %s" % (name, t, v) return "Bad value for parameter %s of type '%s' - %s" % (name, t, v)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment