def test_do_md_property_update(self): args = self._make_args( {"namespace": "MyNamespace", "property": "MyProperty", "name": "NewName", "title": "Title", "schema": "{}"} ) with mock.patch.object(self.gc.metadefs_property, "update") as mocked_update: expect_property = {} expect_property["namespace"] = "MyNamespace" expect_property["name"] = "MyProperty" expect_property["title"] = "Title" mocked_update.return_value = expect_property test_shell.do_md_property_update(self.gc, args) mocked_update.assert_called_once_with("MyNamespace", "MyProperty", name="NewName", title="Title") utils.print_dict.assert_called_once_with(expect_property)
def test_do_md_property_update(self): args = self._make_args({'namespace': 'MyNamespace', 'property': 'MyProperty', 'name': 'NewName', 'title': "Title", 'schema': '{}'}) with mock.patch.object(self.gc.metadefs_property, 'update') as mocked_update: expect_property = {} expect_property['namespace'] = 'MyNamespace' expect_property['name'] = 'MyProperty' expect_property['title'] = 'Title' mocked_update.return_value = expect_property test_shell.do_md_property_update(self.gc, args) mocked_update.assert_called_once_with('MyNamespace', 'MyProperty', name='NewName', title='Title') utils.print_dict.assert_called_once_with(expect_property)