コード例 #1
0
    def test_do_md_namespace_show_resource_type(self):
        args = self._make_args({"namespace": "MyNamespace", "max_column_width": 80, "resource_type": "RESOURCE"})
        with mock.patch.object(self.gc.metadefs_namespace, "get") as mocked_get:
            expect_namespace = {}
            expect_namespace["namespace"] = "MyNamespace"

            mocked_get.return_value = expect_namespace

            test_shell.do_md_namespace_show(self.gc, args)

            mocked_get.assert_called_once_with("MyNamespace", resource_type="RESOURCE")
            utils.print_dict.assert_called_once_with(expect_namespace, 80)
コード例 #2
0
    def test_do_md_namespace_show(self):
        args = self._make_args({'namespace': 'MyNamespace',
                                'max_column_width': 80,
                                'resource_type': None})
        with mock.patch.object(self.gc.metadefs_namespace,
                               'get') as mocked_get:
            expect_namespace = {}
            expect_namespace['namespace'] = 'MyNamespace'

            mocked_get.return_value = expect_namespace

            test_shell.do_md_namespace_show(self.gc, args)

            mocked_get.assert_called_once_with('MyNamespace')
            utils.print_dict.assert_called_once_with(expect_namespace, 80)
コード例 #3
0
    def test_do_md_namespace_show(self):
        args = self._make_args({'namespace': 'MyNamespace',
                                'max_column_width': 80,
                                'resource_type': None})
        with mock.patch.object(self.gc.metadefs_namespace,
                               'get') as mocked_get:
            expect_namespace = {}
            expect_namespace['namespace'] = 'MyNamespace'

            mocked_get.return_value = expect_namespace

            test_shell.do_md_namespace_show(self.gc, args)

            mocked_get.assert_called_once_with('MyNamespace')
            utils.print_dict.assert_called_once_with(expect_namespace, 80)