def test08_delete_derived(self, mocker): """ should allow deleting derived resource """ mocker.return_value = MOCK_RESPONSE api.delete_derived_resources([API_TEST_ID]) args, kargs = mocker.call_args self.assertTrue(get_uri(args).endswith('/derived_resources')) self.assertIn(API_TEST_ID, get_list_param(mocker, 'derived_resource_ids'))
def test08_delete_derived(self): """ should allow deleting derived resource """ uploader.upload("tests/logo.png", public_id="api_test3", eager=[{"width": 101,"crop": "scale"}]) resource = api.resource("api_test3") self.assertNotEqual(resource, None) self.assertEqual(len(resource["derived"]), 1) derived_resource_id = resource["derived"][0]["id"] api.delete_derived_resources([derived_resource_id]) resource = api.resource("api_test3") self.assertNotEqual(resource, None) self.assertEqual(len(resource["derived"]), 0)
def test08_delete_derived(self): """ should allow deleting derived resource """ uploader.upload("tests/logo.png", public_id="api_test3", eager=[{"width": 101,"crop": "scale"}]) resource = api.resource("api_test3") self.assertNotEqual(resource, None) self.assertEqual(len(resource["derived"]), 1) derived_resource_id = resource["derived"][0]["id"] api.delete_derived_resources([derived_resource_id]) resource = api.resource("api_test3") self.assertNotEqual(resource, None) self.assertEqual(len(resource["derived"]), 0)