Beispiel #1
0
 def test_call_list_kw(self):
     args = json.loads('[3,null]')
     kwargs = json.loads('{"d":0.5,"c":"code"}')
     ret = json.loads('[3,null,"code",0.5]')
     self.assertEqual(dealer.call(u'list', args=args, kwargs=kwargs), ret)
Beispiel #2
0
 def test_call_dict(self):
     kwargs = json.loads('{"key":"a","value":34}')
     ret = json.loads('{"a":34}')
     self.assertEqual(dealer.call(u'dict', kwargs=kwargs), ret)
Beispiel #3
0
 def test_call_sum_akw(self):
     args = json.loads('[3,5]')
     ret = json.loads('8')
     self.assertEqual(dealer.call(u'sum', args=args), ret)
Beispiel #4
0
 def test_call_list(self):
     kwargs = json.loads('{"b":null,"a":3,"c":"code","d":0.5}')
     ret = json.loads('[3, null,"code",0.5]')
     self.assertEqual(dealer.call(u'list', kwargs=kwargs), ret)
Beispiel #5
0
 def test_call_sum_kw(self):
     args = json.loads('[3]')
     kwargs = json.loads('{"b":5}')
     ret = json.loads('8')
     self.assertEqual(dealer.call(u'sum', args=args, kwargs=kwargs), ret)
Beispiel #6
0
 def test_call_sum(self):
     kwargs = json.loads('{"a":3,"b":5}')
     ret = json.loads('8')
     self.assertEqual(dealer.call(u'sum', kwargs=kwargs), ret)
Beispiel #7
0
 def test_call_hello_kw(self):
     kwargs = json.loads('{"name":"world"}')
     ret = json.loads('"Hello, world"')
     self.assertEqual(dealer.call(u'hello', kwargs=kwargs), ret)
Beispiel #8
0
 def test_call_hello(self):
     args = json.loads('["world"]')
     ret = json.loads('"Hello, world"')
     self.assertEqual(dealer.call(u'hello', args=args), ret)
Beispiel #9
0
 def test_call_pi(self):
     ret = json.loads('3.141592')
     self.assertEqual(dealer.call(u'pi'), ret)