Beispiel #1
0
 def test_validate_json_fails(self):
     url = URL({"url": "posts/"})
     with captured_stdout() as s:
         url.validate_json({
             "url": "posts/",
             "gets": {
                 "#meta": "oauth2,optional",
                 "response": {
                     "200+": "$postResponse"
                 }
             }
         })
         self.assertEqual(s.getvalue().rstrip("\n"),
                          colorize_string("yellow", "Found unsupported attribute, gets, for url: posts/"))
Beispiel #2
0
 def test_field_process_attribute_error(self):
     with captured_stdout() as out:
         Field("username", ["string", "option"])
         self.assertEqual(out.getvalue().rstrip("\n"),
                          colorize_string("yellow", "Found an unexpected attribute: option on username."))