Sha256: 7dcf0d0c012901dc017b64c325dc62c4788c8a6a1fdc7acc228ad9e87a37595d

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

class TestNetwork < Test::Unit::TestCase

  def test_network

    # https://docs.openstack.org/api-ref/network/v2/#networks
    params = {
      "admin_state_up" => true,
      "id" => "b3680498-03da-4691-896f-ef9ee1d856a7",
      "name" => "net1",
      "provider:network_type" => "vlan",
      "provider:physical_network" => "physnet1",
      "provider:segmentation_id" => 1000,
      "router:external" => false,
      "shared" => false,
      "status" => "ACTIVE",
      "subnets" => [],
      "tenant_id" => "c05140b3dc7c4555afff9fab6b58edc2",
      "project_id" => "c05140b3dc7c4555afff9fab6b58edc2",
    }

    network = Yao::Network.new(params)

    # friendly_attributes
    assert_equal(network.id, "b3680498-03da-4691-896f-ef9ee1d856a7")
    assert_equal(network.name, "net1")
    assert_equal(network.status, "ACTIVE")
    assert_equal(network.shared, false)
    assert_equal(network.shared?, false)
    assert_equal(network.tenant_id, "c05140b3dc7c4555afff9fab6b58edc2")
    assert_equal(network.subnets, [])
    assert_equal(network.admin_state_up, true)

    #map_attribute_to_attribute
    assert_equal(network.physical_network, "physnet1")
    assert_equal(network.type, "vlan")
    assert_equal(network.segmentation_id, 1000)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yao-0.7.0 test/yao/resources/test_network.rb