Beispiel #1
0
    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'}})
Beispiel #2
0
 def test_falsey_body(self):
     target = Response(200, body=[])
     result = target.json()
     self.assertEqual(result, {'status': 200, 'body': []})
Beispiel #3
0
 def test_sparse(self):
     target = Response(200)
     result = target.json()
     self.assertEqual(result, {'status': 200})