#NEWLINE# def test_SourceAddrFilter( self ) : #NEWLINE# #INDENT# source_addr = '16' #NEWLINE# ftype = 'SourceAddrFilter' #NEWLINE# _str_ = [ ( '%s:' % ftype ) , ( 'source_addr = %s' % source_addr ) ] #NEWLINE# _repr_ = ( '<SA \\(src_addr=%s\\)>' % source_addr ) #NEWLINE# extraCommands = [ { #NEWLINE# #INDENT# 'command' : 'fid filter_id' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'command' : ( 'type %s' % ftype ) , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'command' : ( 'source_addr %s' % source_addr ) , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . add_filter ( 'jcli : ' , ftype ) #NEWLINE# self . _test ( 'jcli : ' , [ { #NEWLINE# #INDENT# 'command' : 'persist' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'command' : 'filter -r filter_id' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'command' : 'load' , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# expectedList = _str_ #NEWLINE# self . _test ( 'jcli : ' , [ { #NEWLINE# #INDENT# 'command' : 'filter -s filter_id' , #NEWLINE# 'expect' : expectedList , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# expectedList = [ '#Filter id        Type                   Routes Description' , ( '#filter_id        %s       MO MT  %s' % ( ftype , _repr_ ) ) , 'Total Filters: 1' ] #NEWLINE# self . _test ( 'jcli : ' , [ { #NEWLINE# #INDENT# 'command' : 'filter -l' , #NEWLINE# 'expect' : expectedList , #NEWLINE# #UNINDENT# } ] )