Esempio n. 1
0
 def test_make_response_body_with_ext(self):
     self.expected.update(self.ext)
     self.assertEqual(
         Problem.make_response_body(self.status,
                                    self.title,
                                    self.detail,
                                    ext=self.ext),
         json.dumps(self.expected))
Esempio n. 2
0
 def test_make_response_body_with_instance(self):
     self.expected['instance'] = self.instance
     self.assertEqual(
         Problem.make_response_body(self.status,
                                    self.title,
                                    self.detail,
                                    instance=self.instance),
         json.dumps(self.expected))
Esempio n. 3
0
 def test_make_response_body_with_type(self):
     status = 404
     self.expected['type'] = self.type_
     self.expected['status'] = status
     self.assertEqual(
         Problem.make_response_body(status,
                                    self.title,
                                    self.detail,
                                    type_=self.type_),
         json.dumps(self.expected))
Esempio n. 4
0
 def test_make_response_body(self):
     self.assertEqual(
         Problem.make_response_body(self.status, self.title, self.detail),
         json.dumps(self.expected))
Esempio n. 5
0
 def test_make_response_body_with_ext(self):
     self.expected.update(self.ext)
     self.assertEqual(
         Problem.make_response_body(self.status, self.title, self.detail, ext=self.ext),
         json.dumps(self.expected))
Esempio n. 6
0
 def test_make_response_body_with_type(self):
     status = 404
     self.expected['type'] = self.type_
     self.expected['status'] = status
     self.assertEqual(
         Problem.make_response_body(status, self.title, self.detail, type_=self.type_), json.dumps(self.expected))
Esempio n. 7
0
 def test_make_response_body_with_instance(self):
     self.expected['instance'] = self.instance
     self.assertEqual(
         Problem.make_response_body(self.status, self.title, self.detail, instance=self.instance),
         json.dumps(self.expected))
Esempio n. 8
0
 def test_make_response_body(self):
     self.assertEqual(Problem.make_response_body(self.status, self.title, self.detail), json.dumps(self.expected))