Sha256: f233211620a4943aa5288fc29339398a248968cc68d07d69e0505658c34c6966

Contents?: true

Size: 876 Bytes

Versions: 8

Compression:

Stored size: 876 Bytes

Contents

class TestServerGroup < TestYaoResource
  def test_server_group
    # https://docs.openstack.org/api-ref/compute/?expanded=list-server-groups-detail,show-server-group-details-detail#list-server-groups
    params = {
      "id" => "616fb98f-46ca-475e-917e-2563e5a8cd19",
      "name" => "test",
      "policy" => "anti-affinity",
      "rules" => {"max_server_per_host" => 3},
      "members" => [],
      "project_id" => "6f70656e737461636b20342065766572",
      "user_id" => "fake"
    }

    sg = Yao::ServerGroup.new(params)
    assert_equal("616fb98f-46ca-475e-917e-2563e5a8cd19", sg.id)
    assert_equal("test", sg.name)
    assert_equal("anti-affinity", sg.policy)
    assert_equal({"max_server_per_host" => 3}, sg.rules)
    assert_equal([], sg.members)
    assert_equal("6f70656e737461636b20342065766572", sg.project_id)
    assert_equal("fake", sg.user_id)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
yao-0.21.0 test/yao/resources/test_server_group.rb
yao-0.20.0 test/yao/resources/test_server_group.rb
yao-0.19.0 test/yao/resources/test_server_group.rb
yao-0.18.0 test/yao/resources/test_server_group.rb
yao-0.17.0 test/yao/resources/test_server_group.rb
yao-0.16.0 test/yao/resources/test_server_group.rb
yao-0.15.0 test/yao/resources/test_server_group.rb
yao-0.14.0 test/yao/resources/test_server_group.rb