#NEWLINE# def test_python_magic4( ) : #NEWLINE# #INDENT# kernel = get_kernel ( ) #NEWLINE# kernel . do_execute ( '?%python' , None ) #NEWLINE# assert ( '%python CODE' in get_log_text ( kernel ) ) #NEWLINE# clear_log_text ( kernel ) #NEWLINE# ret = kernel . do_execute ( '?%python a' , None ) #NEWLINE# assert ( ret [ 'payload' ] [ 0 ] [ 'data' ] [ 'text/plain' ] == 'No help available for "a"' ) #NEWLINE# ret = kernel . do_execute ( '?%%python a.b' , None ) #NEWLINE# assert ( ret [ 'payload' ] [ 0 ] [ 'data' ] [ 'text/plain' ] == 'No help available for "a.b"' ) #NEWLINE# ret = kernel . do_execute ( '??%%python oct' , None ) #NEWLINE# assert ret [ 'payload' ] [ 0 ] [ 'data' ] [ 'text/plain' ] . startswith ( 'oct(number)' )