def test_port_show(self): actual = {} fake_print_dict = lambda data, *args, **kwargs: actual.update(data) with mock.patch.object(cliutils, "print_dict", fake_print_dict): port = object() p_shell._print_port_show(port) exp = ["address", "created_at", "extra", "node_uuid", "updated_at", "uuid"] act = actual.keys() self.assertEqual(sorted(exp), sorted(act))
def test_port_show(self): actual = {} fake_print_dict = lambda data, *args, **kwargs: actual.update(data) with mock.patch.object(cliutils, 'print_dict', fake_print_dict): port = object() p_shell._print_port_show(port) exp = ['address', 'created_at', 'extra', 'node_uuid', 'updated_at', 'uuid'] act = actual.keys() self.assertEqual(sorted(exp), sorted(act))
def test_port_show(self): actual = {} fake_print_dict = lambda data, *args, **kwargs: actual.update(data) with mock.patch.object(cliutils, 'print_dict', fake_print_dict): port = object() p_shell._print_port_show(port) exp = ['address', 'created_at', 'extra', 'node_uuid', 'physical_network', 'updated_at', 'uuid', 'pxe_enabled', 'local_link_connection', 'internal_info', 'is_smartnic', 'portgroup_uuid'] act = actual.keys() self.assertEqual(sorted(exp), sorted(act))
def test_port_show(self): actual = {} fake_print_dict = lambda data, *args, **kwargs: actual.update(data) with mock.patch.object(cliutils, 'print_dict', fake_print_dict): port = object() p_shell._print_port_show(port) exp = [ 'address', 'created_at', 'extra', 'node_uuid', 'physical_network', 'updated_at', 'uuid', 'pxe_enabled', 'local_link_connection', 'internal_info', 'portgroup_uuid' ] act = actual.keys() self.assertEqual(sorted(exp), sorted(act))