File: plan_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 (63 lines) | stat: -rw-r--r-- 1,469 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
require "test_helper"

describe "Fog::OpenStack::Planning | plan" do
  describe "success" do
    before do
      @planning = Fog::OpenStack::Planning.new
      @instance = @planning.plans.first
      @role = @planning.list_roles.body.first
    end

    it "#add_role" do
      @instance.add_role(@role['uuid']).body["roles"][0]["uuid"].must_equal @role['uuid']
    end

    it "#templates" do
      @instance.templates.wont_be_empty
    end

    it "#master_template" do
      @instance.master_template.must_be_kind_of String
    end

    it "#environment" do
      @instance.environment.must_be_kind_of String
    end

    it "#provider_resource_templates" do
      @instance.provider_resource_templates["provider-compute-1.yaml"].wont_be_empty
    end

    it "#patch" do
      parameter = @instance.parameters.first
      @instance.patch(
        :parameters => [
          {
            "name"  => parameter['name'],
            "value" => 'new_value'
          }
        ]
      )["uuid"].must_be_kind_of String
    end

    it "#remove_role" do
      @instance.remove_role(@role['uuid']).status.must_equal 200
    end

    it "#save" do
      @instance.save.must_be_kind_of Fog::OpenStack::Planning::Plan
    end

    it "#update" do
      @instance.update.uuid.wont_be_empty
    end

    it "#destroy" do
      @instance.destroy.must_equal true
    end

    it "#create" do
      @instance.create.must_be_kind_of Fog::OpenStack::Planning::Plan
    end
  end
end