Example #1
0
 def test_schemas_for(self):
     schema = validationapp.FooBarSchema
     service = Service("color", "/favorite-color")
     service.add_view("GET", lambda x: "red", schema=schema)
     self.assertEquals(len(service.schemas_for("GET")), 1)
     service.add_view("GET", lambda x: "red", validators=_validator, schema=schema)
     self.assertEquals(len(service.schemas_for("GET")), 2)
Example #2
0
 def test_schemas_for(self):
     schema = validationapp.FooBarSchema
     service = Service("color", "/favorite-color")
     service.add_view("GET", lambda x: "red", schema=schema)
     self.assertEquals(len(service.schemas_for("GET")), 1)
     service.add_view("GET", lambda x: "red", validators=_validator,
                      schema=schema)
     self.assertEquals(len(service.schemas_for("GET")), 2)