File: keypair_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 (35 lines) | stat: -rw-r--r-- 955 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
25
26
27
28
29
30
31
32
33
34
35
require "test_helper"

describe "Fog::OpenStack::Compute | keypair requests" do
  before do
    @keypair_format = {
      "public_key"  => String,
      "private_key" => String,
      "user_id"     => String,
      "name"        => String,
      "fingerprint" => String
    }

    @keypair_list_format = {
      "public_key"  => String,
      "name"        => String,
      "fingerprint" => String
    }
  end

  describe "success" do
    it "#create_key_pair((key_name, public_key = nil))" do
      Fog::OpenStack::Compute.new.create_key_pair('from_shindo_test').body.
        must_match_schema("keypair" => @keypair_format)
    end

    it "#list_key_pairs" do
      Fog::OpenStack::Compute.new.list_key_pairs.body.
        must_match_schema("keypairs" => [{"keypair" => @keypair_list_format}])
    end

    it "#delete_key_pair(key_name)" do
      Fog::OpenStack::Compute.new.delete_key_pair('from_shindo_test').status.must_equal 202
    end
  end
end