def test_from_jsonapi(self, vector_client): r = DotDict(id='foo', attributes=dict(owners=[], readers=[], writers=[], name='name', title='title', description='description')) fc = FeatureCollection._from_jsonapi(r) self.assertIsNotNone(fc.id) for key in r.attributes.keys(): self.assertIsNotNone(getattr(fc, key))
def test_from_jsonapi(self, vector_client): vector_client = mock.MagicMock() r = DotDict( id='foo', attributes=dict( owners=[], readers=[], writers=[], name='name', title='title', description='description')) fc = FeatureCollection._from_jsonapi(r, vector_client=vector_client) self.assertIsNotNone(fc.id) vector_client.get_product.assert_not_called() for key in r.attributes.keys(): self.assertIsNotNone(getattr(fc, key))
def test_from_jsonapi(self, vector_client): vector_client = mock.MagicMock() r = DotDict( id="foo", attributes=dict( owners=[], readers=[], writers=[], name="name", title="title", description="description", ), ) fc = FeatureCollection._from_jsonapi(r, vector_client=vector_client) assert fc.id is not None vector_client.get_product.assert_not_called() for key in r.attributes.keys(): assert getattr(fc, key) is not None