Пример #1
0
    def test_do_md_property_show(self):
        args = self._make_args({"namespace": "MyNamespace", "property": "MyProperty", "max_column_width": 80})
        with mock.patch.object(self.gc.metadefs_property, "get") as mocked_get:
            expect_property = {}
            expect_property["namespace"] = "MyNamespace"
            expect_property["property"] = "MyProperty"
            expect_property["title"] = "Title"

            mocked_get.return_value = expect_property

            test_shell.do_md_property_show(self.gc, args)

            mocked_get.assert_called_once_with("MyNamespace", "MyProperty")
            utils.print_dict.assert_called_once_with(expect_property, 80)
    def test_do_md_property_show(self):
        args = self._make_args({'namespace': 'MyNamespace',
                                'property': 'MyProperty',
                                'max_column_width': 80})
        with mock.patch.object(self.gc.metadefs_property, 'get') as mocked_get:
            expect_property = {}
            expect_property['namespace'] = 'MyNamespace'
            expect_property['property'] = 'MyProperty'
            expect_property['title'] = 'Title'

            mocked_get.return_value = expect_property

            test_shell.do_md_property_show(self.gc, args)

            mocked_get.assert_called_once_with('MyNamespace', 'MyProperty')
            utils.print_dict.assert_called_once_with(expect_property, 80)
Пример #3
0
    def test_do_md_property_show(self):
        args = self._make_args({'namespace': 'MyNamespace',
                                'property': 'MyProperty',
                                'max_column_width': 80})
        with mock.patch.object(self.gc.metadefs_property, 'get') as mocked_get:
            expect_property = {}
            expect_property['namespace'] = 'MyNamespace'
            expect_property['property'] = 'MyProperty'
            expect_property['title'] = 'Title'

            mocked_get.return_value = expect_property

            test_shell.do_md_property_show(self.gc, args)

            mocked_get.assert_called_once_with('MyNamespace', 'MyProperty')
            utils.print_dict.assert_called_once_with(expect_property, 80)