Example #1
0
    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])
Example #2
0
    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]