test/yao/resources/test_router.rb in yao-0.8.0 vs test/yao/resources/test_router.rb in yao-0.9.0

- old
+ new

@@ -57,20 +57,20 @@ ] } router = Yao::Router.new(params) - assert_equal(router.id, "915a14a6-867b-4af7-83d1-70efceb146f9") + assert_equal("915a14a6-867b-4af7-83d1-70efceb146f9", router.id) # friendly_attributes - assert_equal(router.tenant_id, "0bd18306d801447bb457a46252d82d13") - assert_equal(router.project_id, "0bd18306d801447bb457a46252d82d13") - assert_equal(router.name, "router2") - assert_equal(router.description, "") - assert_equal(router.admin_state_up, true) - assert_equal(router.status, "ACTIVE") - assert_equal(router.external_gateway_info, { + assert_equal("0bd18306d801447bb457a46252d82d13", router.tenant_id) + assert_equal("0bd18306d801447bb457a46252d82d13", router.project_id) + assert_equal("router2", router.name) + assert_equal("", router.description) + assert_equal(true, router.admin_state_up) + assert_equal("ACTIVE", router.status) + assert_equal({ "enable_snat" => true, "external_fixed_ips" => [ { "ip_address" => "172.24.4.3", "subnet_id" => "b930d7f6-ceb7-40a0-8b81-a425dd994ccf" @@ -79,27 +79,27 @@ "ip_address" => "2001:db8::c", "subnet_id" => "0c56df5d-ace5-46c8-8f4c-45fa4e334d18" } ], "network_id" => "ae34051f-aa6c-4c75-abf5-50dc9ac99ef3" - }) + }, router.external_gateway_info) - assert_equal(router.routes, [ + assert_equal([ { "destination" => "179.24.1.0/24", "nexthop" => "172.24.3.99" } - ]) + ], router.routes) - assert_equal(router.distributed, false) - assert_equal(router.ha, false) - assert_equal(router.availability_zone_hints, []) - assert_equal(router.availability_zones, [ "nova" ]) + assert_equal(false, router.distributed) + assert_equal(false, router.ha) + assert_equal([], router.availability_zone_hints) + assert_equal([ "nova" ], router.availability_zones) pend 'oops. These are invalid friendly_attributes' - assert_equal(router.network_id, '') - assert_equal(router.enable_snat, '') + assert_equal( '', router.network_id) + assert_equal('', router.enable_snat) assert_equal(router.external_fixed_ips '') assert_equal(router.destination '') assert_equal(router.nexthop '') end @@ -122,11 +122,11 @@ } router = Yao::Router.new(params) port = router.interfaces.first assert_instance_of(Yao::Port, port) - assert_equal(port.id, "00000000-0000-0000-0000-000000000000") + assert_equal("00000000-0000-0000-0000-000000000000", port.id) assert_requested(stub) end def test_tenant @@ -144,10 +144,10 @@ headers: {'Content-Type' => 'application/json'} ) router = Yao::Router.new('tenant_id' => '0123456789abcdef0123456789abcdef') assert_instance_of(Yao::Tenant, router.tenant) - assert_equal(router.tenant.id, '0123456789abcdef0123456789abcdef') + assert_equal('0123456789abcdef0123456789abcdef', router.tenant.id) assert_requested(stub) end end