Exemple #1
0
def test_get_template_by_id():
    res = mock_api_request(
        Message,
        path="/custom/v1/demo_custom_trigger/message/templates/id",
        param={"id": "1"})
    print(res[1])
    assert res[0] == 200
Exemple #2
0
def test_send_sms():
    res = mock_api_request(
        Message,
        path="/custom/v1/demo_custom_trigger/message/send/sms",
        param={
            "tem_id": "1338653753524228097",
            "receiver_list": '"17717456408","18121004328"',
            "code": "12345"
        })
    print(res[1])
    assert res[0] == 200
Exemple #3
0
def test_send_email():
    res = mock_api_request(
        Message,
        path="/custom/v1/demo_custom_trigger/message/send/email",
        param={
            "tem_id": "1",
            "receiver_list": "*****@*****.**",
            "name": "zhangyishu",
            "time": "2021-03-09"
        })
    print(res[1])
    assert res[0] == 200
Exemple #4
0
def test_get_tenants():
    res = mock_api_request(Tenants,
                           path="/custom/v1/demo_custom_trigger/tenants")
    assert res[0] == 200
Exemple #5
0
def test_get_user_info():
    res = mock_api_request(
        Tenants,
        path="/custom/v1/demo_custom_trigger/tenants/users/info",
        param={"userid": "1356436881656082434,1356505003491524609"})
    assert res[0] == 200
Exemple #6
0
def test_get_tenants_user():
    res = mock_api_request(Tenants,
                           path="/custom/v1/demo_custom_trigger/tenants/users",
                           param={"tenantid": "1356430095297376257"})
    assert res[0] == 200
Exemple #7
0
 def test_get(self):
     http_code, body = mock_tools.mock_api_request(ApiExample, "GET")
     self.assertEqual(http_code, 200)
     self.assertEqual(body, {'status': 'ok'})
Exemple #8
0
 def test_post(self):
     http_code, body = mock_tools.mock_api_request(ApiExample, "POST")
     self.assertEqual(http_code, 405)
     self.assertEqual(body, {'status': 'method is not get'})
Exemple #9
0
def test_get_all_templates():
    res = mock_api_request(
        Message, path="/custom/v1/demo_custom_trigger/message/templates")
    print(res[1])
    assert res[0] == 200