#NEWLINE# def testNICParameterSyntaxCheck( self ) : #NEWLINE# #INDENT# "Test the NIC's CheckParameterSyntax function" #NEWLINE# mode = constants . NIC_MODE #NEWLINE# link = constants . NIC_LINK #NEWLINE# m_bridged = constants . NIC_MODE_BRIDGED #NEWLINE# m_routed = constants . NIC_MODE_ROUTED #NEWLINE# CheckSyntax = objects . NIC . CheckParameterSyntax #NEWLINE# CheckSyntax ( constants . NICC_DEFAULTS ) #NEWLINE# CheckSyntax ( { #NEWLINE# #INDENT# mode : m_bridged , #NEWLINE# link : 'br1' , #NEWLINE# #UNINDENT# } ) #NEWLINE# CheckSyntax ( { #NEWLINE# #INDENT# mode : m_routed , #NEWLINE# link : 'default' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertRaises ( errors . ConfigurationError , m_routed , { #NEWLINE# #INDENT# mode : '000invalid' , #NEWLINE# link : 'any' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertRaises ( errors . ConfigurationError , CheckSyntax , { #NEWLINE# #INDENT# mode : m_bridged , #NEWLINE# link : None , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertRaises ( errors . ConfigurationError , CheckSyntax , { #NEWLINE# #INDENT# mode : m_bridged , #NEWLINE# link : '' , #NEWLINE# #UNINDENT# } )