@@ -0,0 +1,1504 @@
+import pytest%0Afrom mock import patch%0A%0Afrom currencycloud import Client, Config%0Afrom currencycloud.http import Http%0Afrom currencycloud.resources.resource import Resource%0Afrom currencycloud.resources.actions import UpdateMixin, DeleteMixin%0A%0A%0Aclass TestResource:%0A    class PersonClient(Http):%0A        def delete(self, resource_id):%0A            pass%0A%0A        def update(self, resource_id, **kwargs):%0A            pass%0A%0A    class Person(DeleteMixin, UpdateMixin, Resource):%0A        pass%0A%0A    def setup_method(self):%0A        self.config = Config(None, None, Config.ENV_DEMONSTRATION)%0A        self.client = TestResource.PersonClient(self.config)%0A%0A    def test_resource_save_only_updates_changed_records(self):%0A        person = TestResource.Person(self.client, id=1, name=%22Some%22, surname=%22One%22)%0A%0A        with patch.object(Http, 'post') as person_post:%0A            def post_check(url, **kargs):%0A                assert url == 1%0A                assert len(kargs) == 1%0A                assert kargs%5B'name'%5D == 'Penelope'%0A%0A            person_post.side_effect = post_check%0A%0A            person.name = 'Penelope'%0A            assert person.update() == person%0A%0A    def test_resource_delete_calls_delete_on_resource(self):%0A        person = TestResource.Person(self.client, id=1, name=%22Some%22, surname=%22One%22)%0A%0A        with patch.object(Http, 'post') as person_post:%0A            def post_check(url, **kargs):%0A                assert url == '1/delete'%0A%0A            person_post.side_effect = post_check%0A            person.delete()%0A

Test update and delete actions