示例#1
0
 def test_convert_function_proper_docstring(self):
     html1 = get_html_from_function_info(PythonFunctionInfo.from_function(proper_func1))
     html2 = get_html_from_function_info(PythonFunctionInfo.from_function(proper_func2))
     # If [unit] is in the html, it has properly identified by
     # convert_function
     self.assertNotEqual(html1.find('[km/s]'), -1)
     self.assertNotEqual(html2.find('[g/cc]'), -1)
示例#2
0
 def test_platform_specific(self):
     html = get_html_from_function_info(PythonFunctionInfo.from_function(proper_func1))
     p = platform.system()
     if p == 'Windows':
         self.assertNotEqual(html.find('<style'), -1)
     else:
         self.assertEqual(html.find('<style'), -1)
示例#3
0
 def test_convert_function_bad_docstring(self):
     html = get_html_from_function_info(PythonFunctionInfo.from_function(bad_func1))
     self.assertEqual(html.find('Parameters'), -1)