Sha256: 86041bdf39aace4306392ea0fd29264a5485f11a5bf384b7317629bb91f1ed81

Contents?: true

Size: 1.36 KB

Versions: 38

Compression:

Stored size: 1.36 KB

Contents

Shindo.tests('Compute::VcloudDirector | task requests', ['vclouddirector']) do

  @service = Fog::Compute::VcloudDirector.new

  tests('error conditions') do
    tests('retrieve non-existent TasksList').raises(Fog::Compute::VcloudDirector::Forbidden) do
      @service.get_task_list('00000000-0000-0000-0000-000000000000')
    end
    tests('retrieve non-existent Task').raises(Fog::Compute::VcloudDirector::Forbidden) do
      @service.get_task('00000000-0000-0000-0000-000000000000')
    end
    tests('cancel non-existent Task').raises(Fog::Compute::VcloudDirector::Forbidden) do
      @service.post_cancel_task('00000000-0000-0000-0000-000000000000')
    end
  end

  @org_id = VcloudDirector::Compute::Helper.current_org_id(@service)

  tests('#get_task_list').data_matches_schema(VcloudDirector::Compute::Schema::TASKS_LIST_TYPE) do
    session = @service.get_current_session.body
    org_href = session[:Link].detect {|l| l[:type] == 'application/vnd.vmware.vcloud.org+xml'}[:href]
    @org_uuid = org_href.split('/').last
    @tasks_list = @service.get_task_list(@org_uuid).body
  end

  tests('each task in the task list') do
    @tasks_list[:Task].each do |task|
      task_id = task[:href].split('/').last
      tests("#get_task(#{task_id}").data_matches_schema(VcloudDirector::Compute::Schema::TASK_TYPE) do
        @service.get_task(task_id).body
      end
    end
  end

end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
fog-1.22.0 tests/vcloud_director/requests/compute/task_tests.rb
fog-1.21.0 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/vcloud_director/requests/compute/task_tests.rb
fog-1.20.0 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/vcloud_director/requests/compute/task_tests.rb
fog-1.19.0 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/vcloud_director/requests/compute/task_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/vcloud_director/requests/compute/task_tests.rb