#NEWLINE# def test_test_record( ) : #NEWLINE# #INDENT# assert_raises ( ValueError , IPC356_TestRecord . from_line , 'P  JOB' , FileSettings ( ) ) #NEWLINE# record_string = '317+5VDC            VIA   -     D0150PA00X 006647Y 012900X0000          S3' #NEWLINE# r = IPC356_TestRecord . from_line ( record_string , FileSettings ( units = 'inch' ) ) #NEWLINE# assert_equal ( r . feature_type , 'through-hole' ) #NEWLINE# assert_equal ( r . net_name , '+5VDC' ) #NEWLINE# assert_equal ( r . id , 'VIA' ) #NEWLINE# assert_almost_equal ( r . hole_diameter , 0.015 ) #NEWLINE# assert_true ( r . plated ) #NEWLINE# assert_equal ( r . access , 'both' ) #NEWLINE# assert_almost_equal ( r . x_coord , 0.6647 ) #NEWLINE# assert_almost_equal ( r . y_coord , 1.29 ) #NEWLINE# assert_equal ( r . rect_x , 0.0 ) #NEWLINE# assert_equal ( r . soldermask_info , 'both' ) #NEWLINE# r = IPC356_TestRecord . from_line ( record_string , FileSettings ( units = 'metric' ) ) #NEWLINE# assert_almost_equal ( r . hole_diameter , 0.15 ) #NEWLINE# assert_almost_equal ( r . x_coord , 6.647 ) #NEWLINE# assert_almost_equal ( r . y_coord , 12.9 ) #NEWLINE# assert_equal ( r . rect_x , 0.0 ) #NEWLINE# assert_equal ( str ( r ) , '<IPC-D-356 +5VDC Test Record: through-hole>' ) #NEWLINE# record_string = '327+3.3VDC          R40   -1         PA01X 032100Y 007124X0236Y0315R180 S0' #NEWLINE# r = IPC356_TestRecord . from_line ( record_string , FileSettings ( units = 'inch' ) ) #NEWLINE# assert_equal ( r . feature_type , 'smt' ) #NEWLINE# assert_equal ( r . net_name , '+3.3VDC' ) #NEWLINE# assert_equal ( r . id , 'R40' ) #NEWLINE# assert_equal ( r . pin , '1' ) #NEWLINE# assert_true ( r . plated ) #NEWLINE# assert_equal ( r . access , 'top' ) #NEWLINE# assert_almost_equal ( r . x_coord , 3.21 ) #NEWLINE# assert_almost_equal ( r . y_coord , 0.7124 ) #NEWLINE# assert_almost_equal ( r . rect_x , 0.0236 ) #NEWLINE# assert_almost_equal ( r . rect_y , 0.0315 ) #NEWLINE# assert_equal ( r . rect_rotation , 180 ) #NEWLINE# assert_equal ( r . soldermask_info , 'none' ) #NEWLINE# r = IPC356_TestRecord . from_line ( record_string , FileSettings ( units = 'metric' ) ) #NEWLINE# assert_almost_equal ( r . x_coord , 32.1 ) #NEWLINE# assert_almost_equal ( r . y_coord , 7.124 ) #NEWLINE# assert_almost_equal ( r . rect_x , 0.236 ) #NEWLINE# assert_almost_equal ( r . rect_y , 0.315 ) #NEWLINE# record_string = '317                 J4    -M2   D0330PA00X 012447Y 008030X0000          S1' #NEWLINE# r = IPC356_TestRecord . from_line ( record_string , FileSettings ( units = 'inch' ) ) #NEWLINE# assert_equal ( r . feature_type , 'through-hole' ) #NEWLINE# assert_equal ( r . id , 'J4' ) #NEWLINE# assert_equal ( r . pin , 'M2' ) #NEWLINE# assert_almost_equal ( r . hole_diameter , 0.033 ) #NEWLINE# assert_true ( r . plated ) #NEWLINE# assert_equal ( r . access , 'both' ) #NEWLINE# assert_almost_equal ( r . x_coord , 1.2447 ) #NEWLINE# assert_almost_equal ( r . y_coord , 0.803 ) #NEWLINE# assert_almost_equal ( r . rect_x , 0.0 ) #NEWLINE# assert_equal ( r . soldermask_info , 'primary side' ) #NEWLINE# record_string = '317SCL              COMMUNICATION-1    D  40PA00X  34000Y  20000X 600Y1200R270 ' #NEWLINE# r = IPC356_TestRecord . from_line ( record_string , FileSettings ( units = 'inch' ) ) #NEWLINE# assert_equal ( r . feature_type , 'through-hole' ) #NEWLINE# assert_equal ( r . net_name , 'SCL' ) #NEWLINE# assert_equal ( r . id , 'COMMUNICATION' ) #NEWLINE# assert_equal ( r . pin , '1' ) #NEWLINE# assert_almost_equal ( r . hole_diameter , 0.004 ) #NEWLINE# assert_true ( r . plated ) #NEWLINE# assert_almost_equal ( r . x_coord , 3.4 ) #NEWLINE# assert_almost_equal ( r . y_coord , 2.0 )