# coding: utf-8 from utils.test_config import * from utils.string_utils import * from helix_web_services_client.models import DepotCommand api = api_as_super() rand = random_string() depot_id = "test-depot-%s" % rand depot_command = DepotCommand() depot_command.depot = depot_id depot_command.type = 'local' depot_command.map = '%s/...' % depot_id depot_command.description = 'test %s' % depot_id api.server_depots_post('localhost', depot_command) all_depots = api.server_depots_get('localhost') assert any(b.depot == depot_id for b in all_depots), "did not find new depot" saved_depot = api.server_depots_depot_get('localhost', depot_id) assert saved_depot.description.strip() == depot_command.description.strip(), "Don't seem to have saved the depot view" to_update = DepotCommand() to_update.description = "Update %s" % rand api.server_depots_depot_patch('localhost', depot_id, to_update) updated = api.server_depots_depot_get('localhost', depot_id) assert updated.description.strip() == to_update.description.strip(), "did not update description" api.server_depots_depot_delete('localhost', depot_id) all_depots2 = api.server_depots_get('localhost') assert any(b.depot == depot_id for b in all_depots2) == False, "did not delete new depot"