#NEWLINE# def test_get_device( self ) : #NEWLINE# #INDENT# config . CONFIG_DIR = os . getcwd ( ) #NEWLINE# config . DEFAULT_DEVICE_FILE = '/tests/test_sample.json' #NEWLINE# config . names = [ 'abc1' ] #NEWLINE# devices = main . get_device ( ) #NEWLINE# self . assertEqual ( len ( devices ) , 1 ) #NEWLINE# self . assertEqual ( devices [ 0 ] . name , 'abc1' ) #NEWLINE# config . name_regex = '.*[1]+.*' #NEWLINE# devices = main . get_device ( ) #NEWLINE# self . assertEqual ( len ( self ) , 1 ) #NEWLINE# assert ( re . match ( config . name_regex , devices [ 0 ] . name ) is not None ) #NEWLINE# config . exclude_name_regex = '.*[1,2]+.*' #NEWLINE# devices = main . get_device ( ) #NEWLINE# self . assertEqual ( len ( devices ) , 0 ) #NEWLINE# config . exclude_name_regex = None #NEWLINE# config . names = [ 'abc1' ] #NEWLINE# devices = main . get_device ( ) #NEWLINE# self . assertEqual ( len ( devices ) , 1 ) #NEWLINE# self . assertEqual ( devices [ 0 ] . name , 'abc1' )