Exemplo n.º 1
0
    def test_update_property(self, requests):
        requests.patch = Mock(return_value=self.get_mock_response({}))
        table = resources.Table(name='users')

        prop = resources.Property(1, 'ysb', False, 'string')

        client = SkyClient()
        client.update_property(table, 'age', prop)
        requests.patch.assert_called_once_with(
            'http://127.0.0.1:8585/tables/users/properties/age',
            headers={'content-type': 'application/json'},
            data='{"data_type": "string", "id": 1, "name": "ysb", "transient": false}'  # NOQA
        )