def test_do_md_namespace_update(self):
        args = self._make_args({"id": "MyNamespace", "protected": True})
        with mock.patch.object(self.gc.metadefs_namespace, "update") as mocked_update:
            expect_namespace = {}
            expect_namespace["namespace"] = "MyNamespace"
            expect_namespace["protected"] = True

            mocked_update.return_value = expect_namespace

            test_shell.do_md_namespace_update(self.gc, args)

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

            mocked_update.return_value = expect_namespace

            test_shell.do_md_namespace_update(self.gc, args)

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

            mocked_update.return_value = expect_namespace

            test_shell.do_md_namespace_update(self.gc, args)

            mocked_update.assert_called_once_with('MyNamespace',
                                                  id='MyNamespace',
                                                  protected=True)
            utils.print_dict.assert_called_once_with(expect_namespace)