<s> '''<STR_LIT>''' <EOL> from __future__ import division , print_function , absolute_import <EOL> import sys <EOL> from numpy . testing import assert_equal , dec <EOL> from scipy . misc import doccer <EOL> DOCSTRINGS_STRIPPED = sys . flags . optimize > <NUM_LIT:1> <EOL> docstring = """<STR_LIT>""" <EOL> param_doc1 = """<STR_LIT>""" <EOL> param_doc2 = """<STR_LIT>""" <EOL> param_doc3 = """<STR_LIT>""" <EOL> doc_dict = { '<STR_LIT>' : param_doc1 , <EOL> '<STR_LIT>' : param_doc2 , <EOL> '<STR_LIT>' : param_doc3 } <EOL> filled_docstring = """<STR_LIT>""" <EOL> def test_unindent ( ) : <EOL> yield assert_equal , doccer . unindent_string ( param_doc1 ) , param_doc1 <EOL> yield assert_equal , doccer . unindent_string ( param_doc2 ) , param_doc2 <EOL> yield assert_equal , doccer . unindent_string ( param_doc3 ) , param_doc1 <EOL> def test_unindent_dict ( ) : <EOL> d2 = doccer . unindent_dict ( doc_dict ) <EOL> yield assert_equal , d2 [ '<STR_LIT>' ] , doc_dict [ '<STR_LIT>' ] <EOL> yield assert_equal , d2 [ '<STR_LIT>' ] , doc_dict [ '<STR_LIT>' ] <EOL> yield assert_equal , d2 [ '<STR_LIT>' ] , doc_dict [ '<STR_LIT>' ] <EOL> def test_docformat ( ) : <EOL> udd = doccer . unindent_dict ( doc_dict ) <EOL> formatted = doccer . docformat ( docstring , udd ) <EOL> yield assert_equal , formatted , filled_docstring <EOL> single_doc = '<STR_LIT>' <EOL> formatted = doccer . docformat ( single_doc , doc_dict ) <EOL> yield assert_equal , formatted , """<STR_LIT>""" <EOL> @ dec . skipif ( DOCSTRINGS_STRIPPED ) <EOL> def test_decorator ( ) : <EOL> decorator = doccer . filldoc ( doc_dict , True ) <EOL> @ decorator <EOL> def func ( ) : <EOL> """<STR_LIT>""" <EOL> yield assert_equal , func . __doc__ , """<STR_LIT>""" <EOL> decorator = doccer . filldoc ( doc_dict , False ) <EOL> @ decorator <EOL> def func ( ) : <EOL> """<STR_LIT>""" <EOL> yield assert_equal , func . __doc__ , """<STR_LIT>""" <EOL> @ dec . skipif ( DOCSTRINGS_STRIPPED ) <EOL> def test_inherit_docstring_from ( ) : <EOL> class Foo ( object ) : <EOL> def func ( self ) : <EOL> '''<STR_LIT>''' <EOL> return <EOL> def func2 ( self ) : <EOL> '''<STR_LIT>''' <EOL> class Bar ( Foo ) : <EOL> @ doccer . inherit_docstring_from ( Foo ) <EOL> def func ( self ) : <EOL> '''<STR_LIT>''' <EOL> return <EOL> @ doccer . inherit_docstring_from ( Foo ) <EOL> def func2 ( self ) : <EOL> return <EOL> assert_equal ( Bar . func . __doc__ , Foo . func . __doc__ + '<STR_LIT>' ) <EOL> assert_equal ( Bar . func2 . __doc__ , Foo . func2 . __doc__ ) <EOL> bar = Bar ( ) <EOL> assert_equal ( bar . func . __doc__ , Foo . func . __doc__ + '<STR_LIT>' ) <EOL> assert_equal ( bar . func2 . __doc__ , Foo . func2 . __doc__ ) </s>
