Beispiel #1
0
 def test_object_from_dict_with_defaults(self):
     schema = Schema.from_dict(self.object_dict, inclusion='automatic')
     self.assertEquals('whatever',
                       schema.inclusion,
                       msg='The schema value should override the default')
     self.assertEquals('automatic', schema.properties['a_string'].inclusion)
     self.assertEquals('automatic',
                       schema.properties['an_array'].items.inclusion)
Beispiel #2
0
 def test_object_from_dict(self):
     self.assertEquals(self.object_obj, Schema.from_dict(self.object_dict))
Beispiel #3
0
 def test_integer_from_dict(self):
     self.assertEquals(self.integer_obj,
                       Schema.from_dict(self.integer_dict))
Beispiel #4
0
 def test_array_from_dict(self):
     self.assertEquals(self.array_obj, Schema.from_dict(self.array_dict))
Beispiel #5
0
 def test_string_from_dict(self):
     self.assertEquals(self.string_obj, Schema.from_dict(self.string_dict))