File: tenant_tests.rb

package info (click to toggle)
ruby-fog-openstack 1.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,784 kB
  • sloc: ruby: 47,937; makefile: 5; sh: 4
file content (24 lines) | stat: -rw-r--r-- 654 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require "test_helper"

describe "Fog::OpenStack::Compute | tenant requests" do
  before do
    @tenant_format = {
      'id'          => String,
      'name'        => String,
      'enabled'     => Fog::Boolean,
      'description' => Fog::Nullable::String
    }
  end

  describe "success" do
    it "#list_tenants" do
      identity = Fog::OpenStack::Identity.new(:openstack_identity_api_version => 'v2.0')
      identity.list_tenants.body.
        must_match_schema('tenants_links' => Array, 'tenants' => [@tenant_format])
    end

    it "#set_tenant admin" do
      Fog::OpenStack::Compute.new.set_tenant("admin").must_equal true
    end
  end
end