Example #1
0
 def test_constructor_from_dict(self, raw_dict):
     schema = CollectionSchema.construct_from_dict(raw_dict)
     assert schema.description, raw_dict['description']
     assert len(schema.fields) == len(raw_dict['fields'])
     f = schema.primary_field
     assert isinstance(f, FieldSchema)
     assert f.name == raw_dict['fields'][2]['name']
Example #2
0
 def test_to_dict(self, raw_dict):
     schema = CollectionSchema.construct_from_dict(raw_dict)
     target = schema.to_dict()
     target.pop("auto_id", None)
     assert target == raw_dict
     assert target is not raw_dict