Пример #1
0
def test_get_request_headers_ok():
    responses.add(responses.POST,
                  'https://user-field.aylanetworks.com/users/sign_in.json',
                  json=LOGIN_PAYLOAD,
                  status=200)

    api = OwletAPI()
    api.set_email("*****@*****.**")
    api.set_password("moped")
    api.login()

    assert api.get_request_headers()['Content-Type'] == "application/json"
    assert api.get_request_headers()['Accept'] == "application/json"
    assert api.get_request_headers()['Authorization'] == "testtoken"
Пример #2
0
def test_get_request_headers_fail():
    api = OwletAPI()

    assert api.get_request_headers() == None