Sha256: af6c7ba46c913f0a8f57f6d0538cde7d4581ad06fd7e5fbd98199ee381a3d209

Contents?: true

Size: 985 Bytes

Versions: 1

Compression:

Stored size: 985 Bytes

Contents

require "time"
require "date"

class TestAggregates < Test::Unit::TestCase
  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.7.0 test/yao/resources/test_aggregates.rb