<s> """<STR_LIT>""" <EOL> from textwrap import dedent <EOL> import jedi <EOL> from . . helpers import unittest <EOL> try : <EOL> import numpydoc <EOL> except ImportError : <EOL> numpydoc_unavailable = True <EOL> else : <EOL> numpydoc_unavailable = False <EOL> class TestDocstring ( unittest . TestCase ) : <EOL> def test_function_doc ( self ) : <EOL> defs = jedi . Script ( """<STR_LIT>""" ) . goto_definitions ( ) <EOL> self . assertEqual ( defs [ <NUM_LIT:0> ] . raw_doc , '<STR_LIT>' ) <EOL> @ unittest . skip ( '<STR_LIT>' ) <EOL> def test_attribute_docstring ( self ) : <EOL> defs = jedi . Script ( """<STR_LIT>""" ) . goto_definitions ( ) <EOL> self . assertEqual ( defs [ <NUM_LIT:0> ] . raw_doc , '<STR_LIT>' ) <EOL> @ unittest . skip ( '<STR_LIT>' ) <EOL> def test_multiple_docstrings ( self ) : <EOL> defs = jedi . Script ( """<STR_LIT>""" ) . goto_definitions ( ) <EOL> docs = [ d . raw_doc for d in defs ] <EOL> self . assertEqual ( docs , [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def test_completion ( self ) : <EOL> assert jedi . Script ( '''<STR_LIT>''' ) . completions ( ) <EOL> def test_docstrings_type_dotted_import ( self ) : <EOL> s = """<STR_LIT>""" <EOL> names = [ c . name for c in jedi . Script ( s ) . completions ( ) ] <EOL> assert '<STR_LIT>' in names <EOL> def test_docstrings_param_type ( self ) : <EOL> s = """<STR_LIT>""" <EOL> names = [ c . name for c in jedi . Script ( s ) . completions ( ) ] <EOL> assert '<STR_LIT>' in names <EOL> def test_docstrings_type_str ( self ) : <EOL> s = """<STR_LIT>""" <EOL> names = [ c . name for c in jedi . Script ( s ) . completions ( ) ] <EOL> assert '<STR_LIT>' in names <EOL> def test_docstring_instance ( self ) : <EOL> s = dedent ( """<STR_LIT>""" ) <EOL> names = [ c . name for c in jedi . Script ( s ) . completions ( ) ] <EOL> assert '<STR_LIT:a>' in names <EOL> assert '<STR_LIT>' in names <EOL> assert '<STR_LIT>' not in names <EOL> @ unittest . skipIf ( numpydoc_unavailable , '<STR_LIT>' ) <EOL> def test_numpydoc_docstring ( self ) : <EOL> s = dedent ( '''<STR_LIT>''' ) <EOL> names = [ c . name for c in jedi . Script ( s ) . completions ( ) ] <EOL> assert '<STR_LIT>' in names <EOL> assert '<STR_LIT>' in names <EOL> @ unittest . skipIf ( numpydoc_unavailable , '<STR_LIT>' ) <EOL> def test_numpydoc_docstring_set_of_values ( self ) : <EOL> s = dedent ( '''<STR_LIT>''' ) <EOL> names = [ c . name for c in jedi . Script ( s ) . completions ( ) ] <EOL> assert '<STR_LIT>' in names <EOL> assert '<STR_LIT>' in names <EOL> assert '<STR_LIT>' in names <EOL> @ unittest . skipIf ( numpydoc_unavailable , '<STR_LIT>' ) <EOL> def test_numpydoc_alternative_types ( self ) : <EOL> s = dedent ( '''<STR_LIT>''' ) <EOL> names = [ c . name for c in jedi . Script ( s ) . completions ( ) ] <EOL> assert '<STR_LIT>' in names <EOL> assert '<STR_LIT>' in names <EOL> assert '<STR_LIT>' in names <EOL> assert '<STR_LIT>' in names </s>
