def test_all_options(self): target = Response( 202, headers={'Content-Type': 'application/json'}, body='the body') result = target.json() self.assertEqual(result, { 'status': 202, 'body': 'the body', 'headers': {'Content-Type': 'application/json'}})
def test_falsey_body(self): target = Response(200, body=[]) result = target.json() self.assertEqual(result, {'status': 200, 'body': []})
def test_sparse(self): target = Response(200) result = target.json() self.assertEqual(result, {'status': 200})