本文整理汇总了Python中coalib.bearlib.languages.documentation.DocstyleDefinition.DocstyleDefinition.get_available_definitions方法的典型用法代码示例。如果您正苦于以下问题:Python DocstyleDefinition.get_available_definitions方法的具体用法?Python DocstyleDefinition.get_available_definitions怎么用?Python DocstyleDefinition.get_available_definitions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coalib.bearlib.languages.documentation.DocstyleDefinition.DocstyleDefinition
的用法示例。
在下文中一共展示了DocstyleDefinition.get_available_definitions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_available_definitions_on_wrong_files
# 需要导入模块: from coalib.bearlib.languages.documentation.DocstyleDefinition import DocstyleDefinition [as 别名]
# 或者: from coalib.bearlib.languages.documentation.DocstyleDefinition.DocstyleDefinition import get_available_definitions [as 别名]
def test_get_available_definitions_on_wrong_files(self,
confparser_mock,
iglob_mock):
# Test the case when a coalang was provided with uppercase letters.
confparser_instance_mock = confparser_mock.return_value
confparser_instance_mock.parse.return_value = ["X"]
iglob_mock.return_value = ['some/CUSTOMSTYLE.coalang',
'SOME/xlang.coalang']
self.assertEqual(list(DocstyleDefinition.get_available_definitions()),
[('xlang', 'x')])
示例2: test_get_available_definitions
# 需要导入模块: from coalib.bearlib.languages.documentation.DocstyleDefinition import DocstyleDefinition [as 别名]
# 或者: from coalib.bearlib.languages.documentation.DocstyleDefinition.DocstyleDefinition import get_available_definitions [as 别名]
def test_get_available_definitions(self):
# Test if the basic supported docstyle-language pairs exist.
expected = {('default', 'python'),
('default', 'python3'),
('default', 'java'),
('doxygen', 'c'),
('doxygen', 'cpp'),
('doxygen', 'cs'),
('doxygen', 'fortran'),
('doxygen', 'java'),
('doxygen', 'python'),
('doxygen', 'python3'),
('doxygen', 'tcl'),
('doxygen', 'vhdl'),
('doxygen', 'php'),
('doxygen', 'objective-c')}
real = set(DocstyleDefinition.get_available_definitions())
self.assertTrue(expected.issubset(real))