def test_chassis_show(self): actual = {} fake_print_dict = lambda data, *args, **kwargs: actual.update(data) with mock.patch.object(cliutils, 'print_dict', fake_print_dict): chassis = object() c_shell._print_chassis_show(chassis) exp = ['created_at', 'description', 'extra', 'updated_at', 'uuid'] act = actual.keys() self.assertEqual(sorted(exp), sorted(act))