コード例 #1
0
 def test_env_creation(self):
     rpc, http, module = setup_test_env()
     self.assertIsNotNone(rpc, RpcClient)
     self.assertIsInstance(http, HttpClient)
     self.assertIsInstance(module, types.ModuleType)
コード例 #2
0
    def test_http_client_call_valid(self):
        _, http, _ = setup_test_env()

        response = http.send('/pingPong', {'val': 5}).json()
        self.assertTrue(response['return'])
コード例 #3
0
 def test_http_client_call_invalid(self):
     _, http, _ = setup_test_env()
     response = http.send('/pingPong').json()
     self.assertEqual(response['response'], 'error')
コード例 #4
0
 def test_http_client_call_invalid_route(self):
     _, http, _ = setup_test_env()
     with self.assertRaises(ValueError):
         http.send('pingPong', {'val': 5})
コード例 #5
0
 def test_rpc_client_call(self):
     rpc, _, _ = setup_test_env()
     self.assertTrue(rpc.pingPong(5))