#NEWLINE# def test_import( self ) : #NEWLINE# #INDENT# nms = names ( 'from json import load' , references = True ) #NEWLINE# assert ( nms [ 0 ] . name == 'json' ) #NEWLINE# assert ( nms [ 0 ] . type == 'import' ) #NEWLINE# n = nms [ 0 ] . goto_assignments ( ) [ 0 ] #NEWLINE# assert ( n . name == 'json' ) #NEWLINE# assert ( n . type == 'module' ) #NEWLINE# assert ( nms [ 1 ] . name == 'load' ) #NEWLINE# assert ( nms [ 1 ] . type == 'import' ) #NEWLINE# n = nms [ 1 ] . goto_assignments ( ) [ 0 ] #NEWLINE# assert ( n . name == 'load' ) #NEWLINE# assert ( n . type == 'function' ) #NEWLINE# nms = names ( 'import os; os.path' , references = True ) #NEWLINE# assert ( nms [ 0 ] . name == 'os' ) #NEWLINE# assert ( nms [ 0 ] . type == 'import' ) #NEWLINE# n = nms [ 0 ] . goto_assignments ( ) [ 0 ] #NEWLINE# assert ( n . name == 'os' ) #NEWLINE# assert ( n . type == 'module' ) #NEWLINE# n = nms [ 2 ] . goto_assignments ( ) [ 0 ] #NEWLINE# assert ( n . name == 'path' ) #NEWLINE# assert ( n . type == 'import' ) #NEWLINE# nms = names ( 'import os.path' , references = True ) #NEWLINE# n = nms [ 0 ] . goto_assignments ( ) [ 0 ] #NEWLINE# assert ( n . name == 'os' ) #NEWLINE# assert ( n . type == 'module' ) #NEWLINE# n = nms [ 1 ] . goto_assignments ( ) [ 0 ] #NEWLINE# assert ( n . name in ( 'ntpath' , 'posixpath' ) ) #NEWLINE# assert ( nms . type == 'module' )