Sha256: 3b423a65d5e4781888d1a15be7daf3d2c625a7a4b225fb0aa622a9de5940eab3

Contents?: true

Size: 949 Bytes

Versions: 1

Compression:

Stored size: 949 Bytes

Contents

class TestAggregates < TestYaoResource
  def test_server_aggregates
    params = {
      "availability_zone" => "nova",
      "deleted" => false,
      "hosts" => ["host1", "host2"],
      "metadata" => {"foo" => "bar"},
      "name" => "nova",
      "created_at" => "2015-08-27T09:49:58-05:00",
      "updated_at" => "2015-08-27T09:49:58-05:00",
      "deleted_at" => "2015-08-27T09:49:58-05:00",
    }

    aggregates = Yao::Aggregates.new(params)
    assert_equal(aggregates.availability_zone, "nova")
    assert_equal(aggregates.deleted, false)
    assert_equal(aggregates.hosts, ["host1", "host2"])
    assert_equal(aggregates.metadata, {"foo" => "bar"})
    assert_equal(aggregates.name, "nova")
    assert_equal(aggregates.created, Time.parse("2015-08-27T09:49:58-05:00"))
    assert_equal(aggregates.updated, Time.parse("2015-08-27T09:49:58-05:00"))
    assert_equal(aggregates.deleted_at, Date.parse("2015-08-27T09:49:58-05:00"))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yao-0.8.0 test/yao/resources/test_aggregates.rb