def test_delete_unauthorized_without_json(session: Session): with requests_mock.Mocker() as m: m.delete('http://citrine-testing.fake/api/v1/bar/something', status_code=401) with pytest.raises(Unauthorized): session.delete_resource('/bar/something')
def test_bad_json_response(session: Session): with requests_mock.Mocker() as m: m.delete('http://citrine-testing.fake/api/v1/bar/something', status_code=200) response_json = session.delete_resource('/bar/something') assert response_json == {}