Beispiel #1
0
 def test_failed_b2c_request(self, mock_post, mock_get):
     response = send_b2c_request(
         int(self.req.amount), self.req.phone, self.req.id
     )
     response = mocks.FAILED_B2C_SEND_RESPONSE
     self.assertEqual(response, mocks.FAILED_B2C_SEND_RESPONSE)
     self.assertTrue(mock_post.called)
Beispiel #2
0
def send_b2c_request_task(amount, phone, id):
    """
    task for send a b2c request
    :param amount:
    :param phone:
    :param id:
    :return:
    """
    return send_b2c_request(amount, phone, id)
Beispiel #3
0
 def test_successful_b2c_request(self, mock_post, mock_get):
     response = send_b2c_request(int(self.req.amount), self.req.phone,
                                 self.req.id)
     self.assertEqual(response, mocks.SUCCESS_B2C_SEND_RESPONSE)
     self.assertTrue(mock_post.called)