def test_fail_get_brands(): responses.add(responses.GET, 'https://api.courier.com/brands', status=400, content_type='application/json', body='{"message": "An error occurred"}') c = Courier(auth_token='123456789ABCDF') with pytest.raises(CourierAPIException): c.get_brands()
def test_success_get_brands_with_params(): responses.add(responses.GET, 'https://api.courier.com/brands?cursor=ABCD1234', status=200, content_type='application/json', body='{"paging": {}, "results": []}') c = Courier(auth_token='123456789ABCDF') r = c.get_brands(cursor="ABCD1234") assert r == {"paging": {}, "results": []}
def test_success_get_brands(): responses.add(responses.GET, 'https://api.trycourier.app/brands', status=200, content_type='application/json', body='{"paging": {}, "results": []}') c = Courier(auth_token='123456789ABCDF') r = c.get_brands() assert r == {"paging": {}, "results": []}