def test_update(self, vector_client): vector_client.update_product.side_effect = lambda id, **attributes: {'data': dict(id=id, attributes=attributes)} attributes = dict(title='title', description='description') fc = FeatureCollection('foo', vector_client=vector_client) fc.update(**attributes) vector_client.update_product.assert_called_once_with( 'foo', **attributes ) for key in attributes.keys(): self.assertEqual(getattr(fc, key), attributes[key])
def test_update(self, vector_client): vector_client.update_product.side_effect = lambda id, **attributes: { "data": dict(id=id, attributes=attributes) } attributes = dict(title="title", description="description") fc = FeatureCollection("foo", vector_client=vector_client) fc.update(**attributes) vector_client.update_product.assert_called_once_with( "foo", **attributes) for key in attributes.keys(): assert getattr(fc, key) == attributes[key]