def test_do_md_property_create(self): args = self._make_args({"namespace": "MyNamespace", "name": "MyProperty", "title": "Title", "schema": "{}"}) with mock.patch.object(self.gc.metadefs_property, "create") as mocked_create: expect_property = {} expect_property["namespace"] = "MyNamespace" expect_property["name"] = "MyProperty" expect_property["title"] = "Title" mocked_create.return_value = expect_property test_shell.do_md_property_create(self.gc, args) mocked_create.assert_called_once_with("MyNamespace", name="MyProperty", title="Title") utils.print_dict.assert_called_once_with(expect_property)
def test_do_md_property_create(self): args = self._make_args({'namespace': 'MyNamespace', 'name': "MyProperty", 'title': "Title", 'schema': '{}'}) with mock.patch.object(self.gc.metadefs_property, 'create') as mocked_create: expect_property = {} expect_property['namespace'] = 'MyNamespace' expect_property['name'] = 'MyProperty' expect_property['title'] = 'Title' mocked_create.return_value = expect_property test_shell.do_md_property_create(self.gc, args) mocked_create.assert_called_once_with('MyNamespace', name='MyProperty', title='Title') utils.print_dict.assert_called_once_with(expect_property)