$:.push File.expand_path("../../lib", __FILE__) require 'helix_web_services_client' require_relative './util/test_config' require_relative './util/string_utils' require 'pp' api = api_as_super rand = random_string depot_id = "test-depot-#{random_string}" depot_command = HelixWebServices::DepotCommand.new( depot: depot_id, type: 'local', map: "#{depot_id}/...", description: "test #{rand}" ) api.server_depots_post('localhost', depot_command) all_depots = api.server_depots_get('localhost') unless all_depots.any? { |b| b.depot == depot_id } raise "Did not locate depot #{depot_id}" end saved_depot = api.server_depots_depot_get('localhost', depot_id) unless saved_depot.description.strip == depot_command.description.strip raise "Did not save description of #{depot_id}" end to_update = HelixWebServices::DepotCommand.new( description: "Update #{rand}" ) api.server_depots_depot_patch('localhost', depot_id, to_update) updated = api.server_depots_depot_get('localhost', depot_id) raise 'depot not updated' if updated.description.strip != to_update.description.strip api.server_depots_depot_delete('localhost', depot_id) all_depots2 = api.server_depots_get('localhost') if all_depots2.any? { |b| b.depot == depot_id } raise "Did not delete depot #{depot_id}" end