(self)
| 393 | page_info.defined_in.path) |
| 394 | |
| 395 | def test_docs_for_function(self): |
| 396 | index = { |
| 397 | 'test_function': test_function |
| 398 | } |
| 399 | |
| 400 | visitor = DummyVisitor(index=index, duplicate_of={}) |
| 401 | |
| 402 | reference_resolver = parser.ReferenceResolver.from_visitor( |
| 403 | visitor=visitor, doc_index={}, py_module_names=['tf']) |
| 404 | |
| 405 | tree = { |
| 406 | '': ['test_function'] |
| 407 | } |
| 408 | parser_config = parser.ParserConfig( |
| 409 | reference_resolver=reference_resolver, |
| 410 | duplicates={}, |
| 411 | duplicate_of={}, |
| 412 | tree=tree, |
| 413 | index=index, |
| 414 | reverse_index={}, |
| 415 | guide_index={}, |
| 416 | base_dir='/') |
| 417 | |
| 418 | page_info = parser.docs_for_object( |
| 419 | full_name='test_function', |
| 420 | py_object=test_function, |
| 421 | parser_config=parser_config) |
| 422 | |
| 423 | # Make sure the brief docstring is present |
| 424 | self.assertEqual( |
| 425 | tf_inspect.getdoc(test_function).split('\n')[0], page_info.doc.brief) |
| 426 | |
| 427 | # Make sure the extracted signature is good. |
| 428 | self.assertEqual(['unused_arg', "unused_kwarg='default'"], |
| 429 | page_info.signature) |
| 430 | |
| 431 | # Make sure this file is contained as the definition location. |
| 432 | self.assertEqual(os.path.relpath(__file__, '/'), page_info.defined_in.path) |
| 433 | |
| 434 | def test_docs_for_function_with_kwargs(self): |
| 435 | index = { |
nothing calls this directly
no test coverage detected