Exemplo n.º 1
0
    def test_do_md_namespace_create(self):
        args = self._make_args({"namespace": "MyNamespace", "protected": True})
        with mock.patch.object(self.gc.metadefs_namespace, "create") as mocked_create:
            expect_namespace = {}
            expect_namespace["namespace"] = "MyNamespace"
            expect_namespace["protected"] = True

            mocked_create.return_value = expect_namespace

            test_shell.do_md_namespace_create(self.gc, args)

            mocked_create.assert_called_once_with(namespace="MyNamespace", protected=True)
            utils.print_dict.assert_called_once_with(expect_namespace)
    def test_do_md_namespace_create(self):
        args = self._make_args({'namespace': 'MyNamespace', 'protected': True})
        with mock.patch.object(self.gc.metadefs_namespace,
                               'create') as mocked_create:
            expect_namespace = {}
            expect_namespace['namespace'] = 'MyNamespace'
            expect_namespace['protected'] = True

            mocked_create.return_value = expect_namespace

            test_shell.do_md_namespace_create(self.gc, args)

            mocked_create.assert_called_once_with(namespace='MyNamespace',
                                                  protected=True)
            utils.print_dict.assert_called_once_with(expect_namespace)
    def test_do_md_namespace_create(self):
        args = self._make_args({'namespace': 'MyNamespace',
                                'protected': True})
        with mock.patch.object(self.gc.metadefs_namespace,
                               'create') as mocked_create:
            expect_namespace = {}
            expect_namespace['namespace'] = 'MyNamespace'
            expect_namespace['protected'] = True

            mocked_create.return_value = expect_namespace

            test_shell.do_md_namespace_create(self.gc, args)

            mocked_create.assert_called_once_with(namespace='MyNamespace',
                                                  protected=True)
            utils.print_dict.assert_called_once_with(expect_namespace)