#NEWLINE# def test_auto_type3( self ) : #NEWLINE# #INDENT# ' Test automatic prefix type guessing\n        ' #NEWLINE# from nipap_cli import nipap_cli #NEWLINE# from pynipap import NipapError #NEWLINE# nipap_cli . cfg = self . mock_cfg ( ) #NEWLINE# th = TestHelper ( ) #NEWLINE# expected = [ ] #NEWLINE# expected . append ( [ th . add_prefix ( '10.0.0.0/16' , 'reservation' , 'test' ) . prefix , 'reservation' ] ) #NEWLINE# expected . append ( [ th . add_prefix ( '10.0.0.0/24' , 'assignment' , 'test' ) . prefix , 'assignment' ] ) #NEWLINE# opts = { #NEWLINE# #INDENT# 'prefix' : '10.0.0.0' , #NEWLINE# 'description' : 'host' , #NEWLINE# #UNINDENT# } #NEWLINE# expected . append ( [ ( opts [ 'prefix' ] + '/32' ) , 'host' ] ) #NEWLINE# nipap_cli . add_prefix ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , opts , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# result = [ [ p . prefix , p . type ] for p in Prefix . smart_search ( '' ) [ 'result' ] ] #NEWLINE# self . assertEqual ( expected , result )