def test_do_port_create_with_uuid(self): client_mock = mock.MagicMock() args = mock.MagicMock() args.uuid = uuidutils.generate_uuid() p_shell.do_port_create(client_mock, args) client_mock.port.create.assert_called_once_with(uuid=args.uuid)
def test_do_port_create_valid_fields_values(self): client_mock = mock.MagicMock() args = mock.MagicMock() args.address = 'address' args.node_uuid = 'uuid' args.extra = ["key1=val1", "key2=val2"] p_shell.do_port_create(client_mock, args) client_mock.port.create.assert_called_once_with( address='address', node_uuid='uuid', extra={'key1': 'val1', 'key2': 'val2'})
def test_do_port_create_physical_network(self): client_mock = mock.MagicMock() args = mock.MagicMock() args.address = 'address' args.node_uuid = 'uuid' args.physical_network = 'physnet1' args.json = False p_shell.do_port_create(client_mock, args) client_mock.port.create.assert_called_once_with( address='address', node_uuid='uuid', physical_network='physnet1')
def test_do_port_create_portgroup_uuid(self): client_mock = mock.MagicMock() args = mock.MagicMock() args.address = 'address' args.node_uuid = 'uuid' args.portgroup_uuid = 'portgroup-uuid' args.json = False p_shell.do_port_create(client_mock, args) client_mock.port.create.assert_called_once_with( address='address', node_uuid='uuid', portgroup_uuid='portgroup-uuid')
def test_do_port_create(self): client_mock = mock.MagicMock() args = mock.MagicMock() p_shell.do_port_create(client_mock, args) client_mock.port.create.assert_called_once_with()