Sha256: 642c5b6c8f98d908674efdd64639b3de67b3ee9b42226781f3642788a3c16ab2

Contents?: true

Size: 1.76 KB

Versions: 96

Compression:

Stored size: 1.76 KB

Contents

Shindo.tests('Fog::Identity[:openstack] | tenant requests', ['openstack']) do

  @tenant_format = {
    'id'   => String,
    'name' => String,
    'enabled'     => Fog::Nullable::Boolean,
    'description' => Fog::Nullable::String
  }

  @role_format = {
    'id'   => String,
    'name' => String
  }

  @tenant_name = Fog::Mock.random_hex(64)
  @tenant_name_update = Fog::Mock.random_hex(64)
  @tenant_name_update2 = Fog::Mock.random_hex(64)

  tests('success') do
    tests('#list_tenants').formats({'tenants' => [@tenant_format], 'tenants_links' => []}) do
      Fog::Identity[:openstack].list_tenants.body
    end

    tests('#list_roles_for_user_on_tenant(0,1)').
      formats({'roles' => [@role_format]}) do

      openstack = Fog::Identity[:openstack]
      openstack.list_roles_for_user_on_tenant(
        openstack.current_tenant['id'], OpenStack::Identity.get_user_id).body
    end

    tests('#create_tenant').formats({'tenant' => @tenant_format}) do
      @tenant = Fog::Identity[:openstack].create_tenant('name' => @tenant_name).body
    end

    tests('#get_tenant').formats({'tenant' => @tenant_format}) do
      Fog::Identity[:openstack].get_tenant(@tenant['tenant']['id']).body
    end

    tests('#update_tenant check format').formats({'tenant' => @tenant_format}) do
      @tenant = Fog::Identity[:openstack].update_tenant(
        @tenant['tenant']['id'], 'name' => @tenant_name_update).body
    end

    tests('#update_tenant update name').succeeds do
      @tenant = Fog::Identity[:openstack].update_tenant(
        @tenant['tenant']['id'], 'name' => @tenant_name_update2).body
      @tenant['tenant']['name'] == @tenant_name_update2
    end

    tests('#delete_tenant').succeeds do
      Fog::Identity[:openstack].delete_tenant(@tenant['tenant']['id'])
    end

  end
end

Version data entries

96 entries across 96 versions & 10 rubygems

Version Path
fog-1.14.0 tests/openstack/requests/identity/tenant_tests.rb
fog-1.13.0 tests/openstack/requests/identity/tenant_tests.rb
gapinc-fog-1.12.1.2 tests/openstack/requests/identity/tenant_tests.rb
gapinc-fog-1.12.1.1 tests/openstack/requests/identity/tenant_tests.rb
gapinc-fog-1.12.1a tests/openstack/requests/identity/tenant_tests.rb
gapinc-fog-1.12.1 tests/openstack/requests/identity/tenant_tests.rb
fog-1.12.1 tests/openstack/requests/identity/tenant_tests.rb
fog-1.12.0 tests/openstack/requests/identity/tenant_tests.rb
hpfog-0.0.20 tests/openstack/requests/identity/tenant_tests.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/tests/openstack/requests/identity/tenant_tests.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/tests/openstack/requests/identity/tenant_tests.rb
fog-1.11.1 tests/openstack/requests/identity/tenant_tests.rb
fog-1.11.0 tests/openstack/requests/identity/tenant_tests.rb
fog-1.10.1 tests/openstack/requests/identity/tenant_tests.rb
fog-test-me-1.10.0 tests/openstack/requests/identity/tenant_tests.rb
fog-1.10.0 tests/openstack/requests/identity/tenant_tests.rb