コード例 #1
0
    def test_do_md_object_update(self):
        args = self._make_args({"namespace": "MyNamespace", "object": "MyObject", "name": "NewName", "schema": "{}"})
        with mock.patch.object(self.gc.metadefs_object, "update") as mocked_update:
            expect_object = {}
            expect_object["namespace"] = "MyNamespace"
            expect_object["name"] = "MyObject"

            mocked_update.return_value = expect_object

            test_shell.do_md_object_update(self.gc, args)

            mocked_update.assert_called_once_with("MyNamespace", "MyObject", name="NewName")
            utils.print_dict.assert_called_once_with(expect_object)
コード例 #2
0
    def test_do_md_object_update(self):
        args = self._make_args({'namespace': 'MyNamespace',
                                'object': 'MyObject',
                                'name': 'NewName',
                                'schema': '{}'})
        with mock.patch.object(self.gc.metadefs_object,
                               'update') as mocked_update:
            expect_object = {}
            expect_object['namespace'] = 'MyNamespace'
            expect_object['name'] = 'MyObject'

            mocked_update.return_value = expect_object

            test_shell.do_md_object_update(self.gc, args)

            mocked_update.assert_called_once_with('MyNamespace', 'MyObject',
                                                  name='NewName')
            utils.print_dict.assert_called_once_with(expect_object)
コード例 #3
0
    def test_do_md_object_update(self):
        args = self._make_args({'namespace': 'MyNamespace',
                                'object': 'MyObject',
                                'name': 'NewName',
                                'schema': '{}'})
        with mock.patch.object(self.gc.metadefs_object,
                               'update') as mocked_update:
            expect_object = {}
            expect_object['namespace'] = 'MyNamespace'
            expect_object['name'] = 'MyObject'

            mocked_update.return_value = expect_object

            test_shell.do_md_object_update(self.gc, args)

            mocked_update.assert_called_once_with('MyNamespace', 'MyObject',
                                                  name='NewName')
            utils.print_dict.assert_called_once_with(expect_object)