$:.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 group_id = "test-group-#{random_string}" group_command = HelixWebServices::GroupCommand.new( group: group_id, users: ['jdoe'], owners: ['jdoe'] ) api.server_groups_post('localhost', group_command) all_groups = api.server_groups_get('localhost') unless all_groups.any? { |b| b.group == group_id } raise "Did not locate group #{group_id}" end saved_group = api.server_groups_group_get('localhost', group_id) unless saved_group.users == group_command.users raise 'users were not saved correctly' end unless saved_group.owners == group_command.owners raise 'owners were not saved correctly' end to_update = HelixWebServices::GroupCommand.new( users: ['mmustermann'] ) api.server_groups_group_patch('localhost', group_id, to_update) updated = api.server_groups_group_get('localhost', group_id) unless updated.users.any? { |u| u == 'mmustermann'} raise 'Group was not updated' end api.server_groups_group_delete('localhost', group_id) all_groups2 = api.server_groups_get('localhost') if all_groups2.any? { |b| b.group == group_id } raise "Did not delete group #{group_id}" end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/ruby/test/default_api.server_groups.crud.rb | |||||
#1 | 19198 | tjuricek |
Ruby Client SDK tests, from branches to jobs. Submitting since I've had to alter the Ruby swagger templates, and I want to make sure I haven't lost something. |