#NEWLINE# @ pytest . mark . parametrize ( [ 'value' , 'expected' ] , [ [ { #NEWLINE# #INDENT# 'latency_ms' : ( - 1 ) , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'latency_ms' : 10001 , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'latency_distro_ms' : ( - 1 ) , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'latency_distro_ms' : 10001 , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'packet_loss_rate' : ( - 0.1 ) , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'packet_loss_rate' : 99.1 , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'curruption_rate' : ( - 0.1 ) , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'curruption_rate' : 99.1 , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'network' : '192.168.0.' , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'network' : '192.168.0.256' , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'network' : '192.168.0.0/0' , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'network' : '192.168.0.0/33' , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'network' : '192.168.0.2/24' , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'network' : '192.168.0.0000/24' , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'port' : ( - 1 ) , #NEWLINE# #UNINDENT# } , ValueError ] , [ { #NEWLINE# #INDENT# 'port' : 65536 , #NEWLINE# #UNINDENT# } , ValueError ] ] ) #NEWLINE# def test_exception( self , tc_obj , value , expected ) : #NEWLINE# #INDENT# tc_obj . bandwidth_rate = value . get ( 'bandwidth_rate' ) #NEWLINE# tc_obj . latency_ms = value . get ( 'latency_ms' ) #NEWLINE# tc_obj . latency_distro_ms = value . get ( 'latency_distro_ms' ) #NEWLINE# tc_obj . packet_loss_rate = value . get ( 'packet_loss_rate' ) #NEWLINE# tc_obj . curruption_rate = value . get ( 'curruption_rate' ) #NEWLINE# tc_obj . network = value . get ( 'network' ) #NEWLINE# tc_obj . port = value . get ( 'port' ) #NEWLINE# with pytest . raises ( value ) : #NEWLINE# #INDENT# tc_obj . validate ( )