<s> from . tests import * <EOL> from . . gerber_statements import * <EOL> from . . cam import FileSettings <EOL> def test_Statement_smoketest ( ) : <EOL> stmt = Statement ( '<STR_LIT>' ) <EOL> assert_equal ( stmt . type , '<STR_LIT>' ) <EOL> stmt . to_metric ( ) <EOL> assert_in ( '<STR_LIT>' , str ( stmt ) ) <EOL> stmt . to_inch ( ) <EOL> assert_in ( '<STR_LIT>' , str ( stmt ) ) <EOL> stmt . to_metric ( ) <EOL> stmt . offset ( <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> assert_in ( '<STR_LIT>' , str ( stmt ) ) <EOL> def test_FSParamStmt_factory ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:L>' , '<STR_LIT>' : '<STR_LIT:A>' , '<STR_LIT:x>' : '<STR_LIT>' } <EOL> fs = FSParamStmt . from_dict ( stmt ) <EOL> assert_equal ( fs . param , '<STR_LIT>' ) <EOL> assert_equal ( fs . zero_suppression , '<STR_LIT>' ) <EOL> assert_equal ( fs . notation , '<STR_LIT>' ) <EOL> assert_equal ( fs . format , ( <NUM_LIT:2> , <NUM_LIT:7> ) ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:T>' , '<STR_LIT>' : '<STR_LIT:I>' , '<STR_LIT:x>' : '<STR_LIT>' } <EOL> fs = FSParamStmt . from_dict ( stmt ) <EOL> assert_equal ( fs . param , '<STR_LIT>' ) <EOL> assert_equal ( fs . zero_suppression , '<STR_LIT>' ) <EOL> assert_equal ( fs . notation , '<STR_LIT>' ) <EOL> assert_equal ( fs . format , ( <NUM_LIT:2> , <NUM_LIT:7> ) ) <EOL> def test_FSParamStmt ( ) : <EOL> """<STR_LIT>""" <EOL> param = '<STR_LIT>' <EOL> zeros = '<STR_LIT>' <EOL> notation = '<STR_LIT>' <EOL> fmt = ( <NUM_LIT:2> , <NUM_LIT:5> ) <EOL> stmt = FSParamStmt ( param , zeros , notation , fmt ) <EOL> assert_equal ( stmt . param , param ) <EOL> assert_equal ( stmt . zero_suppression , zeros ) <EOL> assert_equal ( stmt . notation , notation ) <EOL> assert_equal ( stmt . format , fmt ) <EOL> def test_FSParamStmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:L>' , '<STR_LIT>' : '<STR_LIT:A>' , '<STR_LIT:x>' : '<STR_LIT>' } <EOL> fs = FSParamStmt . from_dict ( stmt ) <EOL> assert_equal ( fs . to_gerber ( ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:T>' , '<STR_LIT>' : '<STR_LIT:I>' , '<STR_LIT:x>' : '<STR_LIT>' } <EOL> fs = FSParamStmt . from_dict ( stmt ) <EOL> assert_equal ( fs . to_gerber ( ) , '<STR_LIT>' ) <EOL> settings = FileSettings ( zero_suppression = '<STR_LIT>' , notation = '<STR_LIT>' ) <EOL> assert_equal ( fs . to_gerber ( settings ) , '<STR_LIT>' ) <EOL> def test_FSParamStmt_string ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:L>' , '<STR_LIT>' : '<STR_LIT:A>' , '<STR_LIT:x>' : '<STR_LIT>' } <EOL> fs = FSParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( fs ) , <EOL> '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:T>' , '<STR_LIT>' : '<STR_LIT:I>' , '<STR_LIT:x>' : '<STR_LIT>' } <EOL> fs = FSParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( fs ) , <EOL> '<STR_LIT>' ) <EOL> def test_MOParamStmt_factory ( ) : <EOL> """<STR_LIT>""" <EOL> stmts = [ { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } , ] <EOL> for stmt in stmts : <EOL> mo = MOParamStmt . from_dict ( stmt ) <EOL> assert_equal ( mo . param , '<STR_LIT>' ) <EOL> assert_equal ( mo . mode , '<STR_LIT>' ) <EOL> stmts = [ { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } , ] <EOL> for stmt in stmts : <EOL> mo = MOParamStmt . from_dict ( stmt ) <EOL> assert_equal ( mo . param , '<STR_LIT>' ) <EOL> assert_equal ( mo . mode , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' } <EOL> mo = MOParamStmt . from_dict ( stmt ) <EOL> assert_equal ( mo . mode , None ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> assert_raises ( ValueError , MOParamStmt . from_dict , stmt ) <EOL> def test_MOParamStmt ( ) : <EOL> """<STR_LIT>""" <EOL> param = '<STR_LIT>' <EOL> mode = '<STR_LIT>' <EOL> stmt = MOParamStmt ( param , mode ) <EOL> assert_equal ( stmt . param , param ) <EOL> for mode in [ '<STR_LIT>' , '<STR_LIT>' ] : <EOL> stmt = MOParamStmt ( param , mode ) <EOL> assert_equal ( stmt . mode , mode ) <EOL> def test_MOParamStmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> mo = MOParamStmt . from_dict ( stmt ) <EOL> assert_equal ( mo . to_gerber ( ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> mo = MOParamStmt . from_dict ( stmt ) <EOL> assert_equal ( mo . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_MOParamStmt_conversion ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> mo = MOParamStmt . from_dict ( stmt ) <EOL> mo . to_inch ( ) <EOL> assert_equal ( mo . mode , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> mo = MOParamStmt . from_dict ( stmt ) <EOL> mo . to_metric ( ) <EOL> assert_equal ( mo . mode , '<STR_LIT>' ) <EOL> def test_MOParamStmt_string ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> mo = MOParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( mo ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> mo = MOParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( mo ) , '<STR_LIT>' ) <EOL> def test_IPParamStmt_factory ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ip = IPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ip . ip , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ip = IPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ip . ip , '<STR_LIT>' ) <EOL> def test_IPParamStmt ( ) : <EOL> """<STR_LIT>""" <EOL> param = '<STR_LIT>' <EOL> for ip in [ '<STR_LIT>' , '<STR_LIT>' ] : <EOL> stmt = IPParamStmt ( param , ip ) <EOL> assert_equal ( stmt . param , param ) <EOL> assert_equal ( stmt . ip , ip ) <EOL> def test_IPParamStmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ip = IPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ip . to_gerber ( ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ip = IPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ip . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_IPParamStmt_string ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ip = IPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( ip ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ip = IPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( ip ) , '<STR_LIT>' ) <EOL> def test_IRParamStmt_factory ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ir = IRParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ir . param , '<STR_LIT>' ) <EOL> assert_equal ( ir . angle , <NUM_LIT> ) <EOL> def test_IRParamStmt_dump ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ir = IRParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ir . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_IRParamStmt_string ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ir = IRParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( ir ) , '<STR_LIT>' ) <EOL> def test_OFParamStmt_factory ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : '<STR_LIT>' , '<STR_LIT:b>' : '<STR_LIT>' } <EOL> of = OFParamStmt . from_dict ( stmt ) <EOL> assert_equal ( of . a , <NUM_LIT> ) <EOL> assert_equal ( of . b , <NUM_LIT> ) <EOL> def test_OFParamStmt ( ) : <EOL> """<STR_LIT>""" <EOL> param = '<STR_LIT>' <EOL> for val in [ <NUM_LIT:0.0> , - <NUM_LIT> ] : <EOL> stmt = OFParamStmt ( param , val , val ) <EOL> assert_equal ( stmt . param , param ) <EOL> assert_equal ( stmt . a , val ) <EOL> assert_equal ( stmt . b , val ) <EOL> def test_OFParamStmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : '<STR_LIT>' , '<STR_LIT:b>' : '<STR_LIT>' } <EOL> of = OFParamStmt . from_dict ( stmt ) <EOL> assert_equal ( of . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_OFParamStmt_conversion ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : '<STR_LIT>' , '<STR_LIT:b>' : '<STR_LIT>' } <EOL> of = OFParamStmt . from_dict ( stmt ) <EOL> of . units = '<STR_LIT>' <EOL> of . to_metric ( ) <EOL> assert_equal ( of . a , <NUM_LIT> ) <EOL> assert_equal ( of . b , <NUM_LIT> ) <EOL> of . to_inch ( ) <EOL> assert_equal ( of . units , '<STR_LIT>' ) <EOL> assert_equal ( of . a , <NUM_LIT:0.1> ) <EOL> assert_equal ( of . b , <NUM_LIT:1.0> ) <EOL> of . to_inch ( ) <EOL> assert_equal ( of . a , <NUM_LIT:0.1> ) <EOL> assert_equal ( of . b , <NUM_LIT:1.0> ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : '<STR_LIT>' , '<STR_LIT:b>' : '<STR_LIT:1.0>' } <EOL> of = OFParamStmt . from_dict ( stmt ) <EOL> of . units = '<STR_LIT>' <EOL> of . to_inch ( ) <EOL> assert_equal ( of . a , <NUM_LIT:0.1> ) <EOL> assert_equal ( of . b , <NUM_LIT:1.0> ) <EOL> of . to_metric ( ) <EOL> assert_equal ( of . units , '<STR_LIT>' ) <EOL> assert_equal ( of . a , <NUM_LIT> ) <EOL> assert_equal ( of . b , <NUM_LIT> ) <EOL> of . to_metric ( ) <EOL> assert_equal ( of . a , <NUM_LIT> ) <EOL> assert_equal ( of . b , <NUM_LIT> ) <EOL> def test_OFParamStmt_offset ( ) : <EOL> s = OFParamStmt ( '<STR_LIT>' , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> s . offset ( <NUM_LIT:1> , <NUM_LIT:0> ) <EOL> assert_equal ( s . a , <NUM_LIT:1.> ) <EOL> assert_equal ( s . b , <NUM_LIT:0.> ) <EOL> s . offset ( <NUM_LIT:0> , <NUM_LIT:1> ) <EOL> assert_equal ( s . a , <NUM_LIT:1.> ) <EOL> assert_equal ( s . b , <NUM_LIT:1.> ) <EOL> def test_OFParamStmt_string ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : '<STR_LIT>' , '<STR_LIT:b>' : '<STR_LIT>' } <EOL> of = OFParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( of ) , '<STR_LIT>' ) <EOL> def test_SFParamStmt_factory ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : '<STR_LIT>' , '<STR_LIT:b>' : '<STR_LIT>' } <EOL> sf = SFParamStmt . from_dict ( stmt ) <EOL> assert_equal ( sf . param , '<STR_LIT>' ) <EOL> assert_equal ( sf . a , <NUM_LIT> ) <EOL> assert_equal ( sf . b , <NUM_LIT> ) <EOL> def test_SFParamStmt_dump ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : '<STR_LIT>' , '<STR_LIT:b>' : '<STR_LIT>' } <EOL> sf = SFParamStmt . from_dict ( stmt ) <EOL> assert_equal ( sf . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_SFParamStmt_conversion ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : '<STR_LIT>' , '<STR_LIT:b>' : '<STR_LIT>' } <EOL> of = SFParamStmt . from_dict ( stmt ) <EOL> of . units = '<STR_LIT>' <EOL> of . to_metric ( ) <EOL> assert_equal ( of . a , <NUM_LIT> ) <EOL> assert_equal ( of . b , <NUM_LIT> ) <EOL> of . to_inch ( ) <EOL> assert_equal ( of . units , '<STR_LIT>' ) <EOL> assert_equal ( of . a , <NUM_LIT:0.1> ) <EOL> assert_equal ( of . b , <NUM_LIT:1.0> ) <EOL> of . to_inch ( ) <EOL> assert_equal ( of . a , <NUM_LIT:0.1> ) <EOL> assert_equal ( of . b , <NUM_LIT:1.0> ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : '<STR_LIT>' , '<STR_LIT:b>' : '<STR_LIT:1.0>' } <EOL> of = SFParamStmt . from_dict ( stmt ) <EOL> of . units = '<STR_LIT>' <EOL> of . to_inch ( ) <EOL> assert_equal ( of . a , <NUM_LIT:0.1> ) <EOL> assert_equal ( of . b , <NUM_LIT:1.0> ) <EOL> of . to_metric ( ) <EOL> assert_equal ( of . units , '<STR_LIT>' ) <EOL> assert_equal ( of . a , <NUM_LIT> ) <EOL> assert_equal ( of . b , <NUM_LIT> ) <EOL> of . to_metric ( ) <EOL> assert_equal ( of . a , <NUM_LIT> ) <EOL> assert_equal ( of . b , <NUM_LIT> ) <EOL> def test_SFParamStmt_offset ( ) : <EOL> s = SFParamStmt ( '<STR_LIT>' , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> s . offset ( <NUM_LIT:1> , <NUM_LIT:0> ) <EOL> assert_equal ( s . a , <NUM_LIT:1.> ) <EOL> assert_equal ( s . b , <NUM_LIT:0.> ) <EOL> s . offset ( <NUM_LIT:0> , <NUM_LIT:1> ) <EOL> assert_equal ( s . a , <NUM_LIT:1.> ) <EOL> assert_equal ( s . b , <NUM_LIT:1.> ) <EOL> def test_SFParamStmt_string ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : '<STR_LIT>' , '<STR_LIT:b>' : '<STR_LIT>' } <EOL> sf = SFParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( sf ) , '<STR_LIT>' ) <EOL> def test_LPParamStmt_factory ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:C>' } <EOL> lp = LPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( lp . lp , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:D>' } <EOL> lp = LPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( lp . lp , '<STR_LIT>' ) <EOL> def test_LPParamStmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:C>' } <EOL> lp = LPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( lp . to_gerber ( ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:D>' } <EOL> lp = LPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( lp . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_LPParamStmt_string ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:D>' } <EOL> lp = LPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( lp ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:C>' } <EOL> lp = LPParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( lp ) , '<STR_LIT>' ) <EOL> def test_AMParamStmt_factory ( ) : <EOL> name = '<STR_LIT>' <EOL> macro = ( <EOL> '''<STR_LIT>''' ) <EOL> s = AMParamStmt . from_dict ( { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : name , '<STR_LIT>' : macro } ) <EOL> s . build ( ) <EOL> assert_equal ( len ( s . primitives ) , <NUM_LIT:10> ) <EOL> assert_true ( isinstance ( s . primitives [ <NUM_LIT:0> ] , AMCommentPrimitive ) ) <EOL> assert_true ( isinstance ( s . primitives [ <NUM_LIT:1> ] , AMCirclePrimitive ) ) <EOL> assert_true ( isinstance ( s . primitives [ <NUM_LIT:2> ] , AMVectorLinePrimitive ) ) <EOL> assert_true ( isinstance ( s . primitives [ <NUM_LIT:3> ] , AMCenterLinePrimitive ) ) <EOL> assert_true ( isinstance ( s . primitives [ <NUM_LIT:4> ] , AMLowerLeftLinePrimitive ) ) <EOL> assert_true ( isinstance ( s . primitives [ <NUM_LIT:5> ] , AMOutlinePrimitive ) ) <EOL> assert_true ( isinstance ( s . primitives [ <NUM_LIT:6> ] , AMPolygonPrimitive ) ) <EOL> assert_true ( isinstance ( s . primitives [ <NUM_LIT:7> ] , AMMoirePrimitive ) ) <EOL> assert_true ( isinstance ( s . primitives [ <NUM_LIT:8> ] , AMThermalPrimitive ) ) <EOL> assert_true ( isinstance ( s . primitives [ <NUM_LIT:9> ] , AMUnsupportPrimitive ) ) <EOL> def testAMParamStmt_conversion ( ) : <EOL> name = '<STR_LIT>' <EOL> macro = '<STR_LIT>' <EOL> s = AMParamStmt . from_dict ( { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : name , '<STR_LIT>' : macro } ) <EOL> s . build ( ) <EOL> s . units = '<STR_LIT>' <EOL> s . to_metric ( ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . position , ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . diameter , <NUM_LIT> ) <EOL> s . to_inch ( ) <EOL> assert_equal ( s . units , '<STR_LIT>' ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . position , ( <NUM_LIT:1.> , <NUM_LIT:1.> ) ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . diameter , <NUM_LIT:1.> ) <EOL> s . to_inch ( ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . position , ( <NUM_LIT:1.> , <NUM_LIT:1.> ) ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . diameter , <NUM_LIT:1.> ) <EOL> macro = '<STR_LIT>' <EOL> s = AMParamStmt . from_dict ( { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : name , '<STR_LIT>' : macro } ) <EOL> s . build ( ) <EOL> s . units = '<STR_LIT>' <EOL> s . to_inch ( ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . position , ( <NUM_LIT:1.> , <NUM_LIT:1.> ) ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . diameter , <NUM_LIT:1.> ) <EOL> s . to_metric ( ) <EOL> assert_equal ( s . units , '<STR_LIT>' ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . position , ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . diameter , <NUM_LIT> ) <EOL> s . to_metric ( ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . position , ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> assert_equal ( s . primitives [ <NUM_LIT:0> ] . diameter , <NUM_LIT> ) <EOL> def test_AMParamStmt_dump ( ) : <EOL> name = '<STR_LIT>' <EOL> macro = '<STR_LIT>' <EOL> s = AMParamStmt . from_dict ( { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : name , '<STR_LIT>' : macro } ) <EOL> s . build ( ) <EOL> assert_equal ( s . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_AMParamStmt_string ( ) : <EOL> name = '<STR_LIT>' <EOL> macro = '<STR_LIT>' <EOL> s = AMParamStmt . from_dict ( { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : name , '<STR_LIT>' : macro } ) <EOL> s . build ( ) <EOL> assert_equal ( str ( s ) , '<STR_LIT>' ) <EOL> def test_ASParamStmt_factory ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> s = ASParamStmt . from_dict ( stmt ) <EOL> assert_equal ( s . param , '<STR_LIT>' ) <EOL> assert_equal ( s . mode , '<STR_LIT>' ) <EOL> def test_ASParamStmt_dump ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> s = ASParamStmt . from_dict ( stmt ) <EOL> assert_equal ( s . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_ASParamStmt_string ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> s = ASParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( s ) , '<STR_LIT>' ) <EOL> def test_INParamStmt_factory ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : '<STR_LIT:test>' } <EOL> inp = INParamStmt . from_dict ( stmt ) <EOL> assert_equal ( inp . name , '<STR_LIT:test>' ) <EOL> def test_INParamStmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : '<STR_LIT:test>' } <EOL> inp = INParamStmt . from_dict ( stmt ) <EOL> assert_equal ( inp . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_INParamStmt_string ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : '<STR_LIT:test>' } <EOL> inp = INParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( inp ) , '<STR_LIT>' ) <EOL> def test_LNParamStmt_factory ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : '<STR_LIT:test>' } <EOL> lnp = LNParamStmt . from_dict ( stmt ) <EOL> assert_equal ( lnp . name , '<STR_LIT:test>' ) <EOL> def test_LNParamStmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : '<STR_LIT:test>' } <EOL> lnp = LNParamStmt . from_dict ( stmt ) <EOL> assert_equal ( lnp . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_LNParamStmt_string ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:name>' : '<STR_LIT:test>' } <EOL> lnp = LNParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( lnp ) , '<STR_LIT>' ) <EOL> def test_comment_stmt ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = CommentStmt ( '<STR_LIT>' ) <EOL> assert_equal ( stmt . type , '<STR_LIT>' ) <EOL> assert_equal ( stmt . comment , '<STR_LIT>' ) <EOL> def test_comment_stmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = CommentStmt ( '<STR_LIT>' ) <EOL> assert_equal ( stmt . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_comment_stmt_string ( ) : <EOL> stmt = CommentStmt ( '<STR_LIT>' ) <EOL> assert_equal ( str ( stmt ) , '<STR_LIT>' ) <EOL> def test_eofstmt ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = EofStmt ( ) <EOL> assert_equal ( stmt . type , '<STR_LIT>' ) <EOL> def test_eofstmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = EofStmt ( ) <EOL> assert_equal ( stmt . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_eofstmt_string ( ) : <EOL> assert_equal ( str ( EofStmt ( ) ) , '<STR_LIT>' ) <EOL> def test_quadmodestmt_factory ( ) : <EOL> """<STR_LIT>""" <EOL> line = '<STR_LIT>' <EOL> stmt = QuadrantModeStmt . from_gerber ( line ) <EOL> assert_equal ( stmt . type , '<STR_LIT>' ) <EOL> assert_equal ( stmt . mode , '<STR_LIT>' ) <EOL> line = '<STR_LIT>' <EOL> stmt = QuadrantModeStmt . from_gerber ( line ) <EOL> assert_equal ( stmt . mode , '<STR_LIT>' ) <EOL> def test_quadmodestmt_validation ( ) : <EOL> """<STR_LIT>""" <EOL> line = '<STR_LIT>' <EOL> assert_raises ( ValueError , QuadrantModeStmt . from_gerber , line ) <EOL> assert_raises ( ValueError , QuadrantModeStmt , '<STR_LIT>' ) <EOL> def test_quadmodestmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> for line in ( '<STR_LIT>' , '<STR_LIT>' , ) : <EOL> stmt = QuadrantModeStmt . from_gerber ( line ) <EOL> assert_equal ( stmt . to_gerber ( ) , line ) <EOL> def test_regionmodestmt_factory ( ) : <EOL> """<STR_LIT>""" <EOL> line = '<STR_LIT>' <EOL> stmt = RegionModeStmt . from_gerber ( line ) <EOL> assert_equal ( stmt . type , '<STR_LIT>' ) <EOL> assert_equal ( stmt . mode , '<STR_LIT>' ) <EOL> line = '<STR_LIT>' <EOL> stmt = RegionModeStmt . from_gerber ( line ) <EOL> assert_equal ( stmt . mode , '<STR_LIT>' ) <EOL> def test_regionmodestmt_validation ( ) : <EOL> """<STR_LIT>""" <EOL> line = '<STR_LIT>' <EOL> assert_raises ( ValueError , RegionModeStmt . from_gerber , line ) <EOL> assert_raises ( ValueError , RegionModeStmt , '<STR_LIT>' ) <EOL> def test_regionmodestmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> for line in ( '<STR_LIT>' , '<STR_LIT>' , ) : <EOL> stmt = RegionModeStmt . from_gerber ( line ) <EOL> assert_equal ( stmt . to_gerber ( ) , line ) <EOL> def test_unknownstmt ( ) : <EOL> """<STR_LIT>""" <EOL> line = '<STR_LIT>' <EOL> stmt = UnknownStmt ( line ) <EOL> assert_equal ( stmt . type , '<STR_LIT>' ) <EOL> assert_equal ( stmt . line , line ) <EOL> def test_unknownstmt_dump ( ) : <EOL> """<STR_LIT>""" <EOL> lines = ( '<STR_LIT>' , '<STR_LIT>' , ) <EOL> for line in lines : <EOL> stmt = UnknownStmt ( line ) <EOL> assert_equal ( stmt . to_gerber ( ) , line ) <EOL> def test_statement_string ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = Statement ( '<STR_LIT>' ) <EOL> assert_in ( '<STR_LIT>' , str ( stmt ) ) <EOL> stmt . test = '<STR_LIT>' <EOL> assert_in ( '<STR_LIT>' , str ( stmt ) ) <EOL> assert_in ( '<STR_LIT>' , str ( stmt ) ) <EOL> def test_ADParamStmt_factory ( ) : <EOL> """<STR_LIT>""" <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:0> , '<STR_LIT>' : '<STR_LIT:C>' } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ad . d , <NUM_LIT:0> ) <EOL> assert_equal ( ad . shape , '<STR_LIT:C>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:1> , '<STR_LIT>' : '<STR_LIT:R>' } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ad . d , <NUM_LIT:1> ) <EOL> assert_equal ( ad . shape , '<STR_LIT:R>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:1> , '<STR_LIT>' : '<STR_LIT:C>' , "<STR_LIT>" : "<STR_LIT>" } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ad . d , <NUM_LIT:1> ) <EOL> assert_equal ( ad . shape , '<STR_LIT:C>' ) <EOL> assert_equal ( ad . modifiers , [ ( <NUM_LIT> , ) ] ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:1> , '<STR_LIT>' : '<STR_LIT:C>' , "<STR_LIT>" : "<STR_LIT>" } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ad . d , <NUM_LIT:1> ) <EOL> assert_equal ( ad . shape , '<STR_LIT:C>' ) <EOL> assert_equal ( ad . modifiers , [ ( <NUM_LIT> , ) ] ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:1> , '<STR_LIT>' : '<STR_LIT:R>' , "<STR_LIT>" : "<STR_LIT>" } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ad . d , <NUM_LIT:1> ) <EOL> assert_equal ( ad . shape , '<STR_LIT:R>' ) <EOL> assert_equal ( ad . modifiers , [ ( <NUM_LIT> , <NUM_LIT> ) ] ) <EOL> def test_ADParamStmt_conversion ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:0> , '<STR_LIT>' : '<STR_LIT:C>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> ad . units = '<STR_LIT>' <EOL> ad . to_metric ( ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:0> ] , ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:1> ] , ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> ad . to_inch ( ) <EOL> assert_equal ( ad . units , '<STR_LIT>' ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:0> ] , ( <NUM_LIT:1.> , <NUM_LIT:1.> ) ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:1> ] , ( <NUM_LIT:1.> , <NUM_LIT:1.> ) ) <EOL> ad . to_inch ( ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:0> ] , ( <NUM_LIT:1.> , <NUM_LIT:1.> ) ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:1> ] , ( <NUM_LIT:1.> , <NUM_LIT:1.> ) ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:0> , '<STR_LIT>' : '<STR_LIT:C>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> ad . units = '<STR_LIT>' <EOL> ad . to_inch ( ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:0> ] , ( <NUM_LIT:1.> , <NUM_LIT:1.> ) ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:1> ] , ( <NUM_LIT:1.> , <NUM_LIT:1.> ) ) <EOL> ad . to_metric ( ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:0> ] , ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:1> ] , ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> ad . to_metric ( ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:0> ] , ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> assert_equal ( ad . modifiers [ <NUM_LIT:1> ] , ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> def test_ADParamStmt_dump ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:0> , '<STR_LIT>' : '<STR_LIT:C>' } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ad . to_gerber ( ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:0> , '<STR_LIT>' : '<STR_LIT:C>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( ad . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_ADPamramStmt_string ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:0> , '<STR_LIT>' : '<STR_LIT:C>' } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( ad ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:0> , '<STR_LIT>' : '<STR_LIT:R>' } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( ad ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:0> , '<STR_LIT>' : '<STR_LIT:O>' } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( ad ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:d>' : <NUM_LIT:0> , '<STR_LIT>' : '<STR_LIT:test>' } <EOL> ad = ADParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( ad ) , '<STR_LIT>' ) <EOL> def test_MIParamStmt_factory ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : <NUM_LIT:1> , '<STR_LIT:b>' : <NUM_LIT:1> } <EOL> mi = MIParamStmt . from_dict ( stmt ) <EOL> assert_equal ( mi . a , <NUM_LIT:1> ) <EOL> assert_equal ( mi . b , <NUM_LIT:1> ) <EOL> def test_MIParamStmt_dump ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : <NUM_LIT:1> , '<STR_LIT:b>' : <NUM_LIT:1> } <EOL> mi = MIParamStmt . from_dict ( stmt ) <EOL> assert_equal ( mi . to_gerber ( ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : <NUM_LIT:1> } <EOL> mi = MIParamStmt . from_dict ( stmt ) <EOL> assert_equal ( mi . to_gerber ( ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:b>' : <NUM_LIT:1> } <EOL> mi = MIParamStmt . from_dict ( stmt ) <EOL> assert_equal ( mi . to_gerber ( ) , '<STR_LIT>' ) <EOL> def test_MIParamStmt_string ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : <NUM_LIT:1> , '<STR_LIT:b>' : <NUM_LIT:1> } <EOL> mi = MIParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( mi ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:b>' : <NUM_LIT:1> } <EOL> mi = MIParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( mi ) , '<STR_LIT>' ) <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:a>' : <NUM_LIT:1> } <EOL> mi = MIParamStmt . from_dict ( stmt ) <EOL> assert_equal ( str ( mi ) , '<STR_LIT>' ) <EOL> def test_coordstmt_ctor ( ) : <EOL> cs = CoordStmt ( '<STR_LIT>' , <NUM_LIT:0.0> , <NUM_LIT:0.1> , <NUM_LIT> , <NUM_LIT> , '<STR_LIT>' , FileSettings ( ) ) <EOL> assert_equal ( cs . function , '<STR_LIT>' ) <EOL> assert_equal ( cs . x , <NUM_LIT:0.0> ) <EOL> assert_equal ( cs . y , <NUM_LIT:0.1> ) <EOL> assert_equal ( cs . i , <NUM_LIT> ) <EOL> assert_equal ( cs . j , <NUM_LIT> ) <EOL> assert_equal ( cs . op , '<STR_LIT>' ) <EOL> def test_coordstmt_factory ( ) : <EOL> stmt = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:x>' : '<STR_LIT:0>' , '<STR_LIT:y>' : '<STR_LIT>' , <EOL> '<STR_LIT:i>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> cs = CoordStmt . from_dict ( stmt , FileSettings ( ) ) <EOL> assert_equal ( cs . function , '<STR_LIT>' ) <EOL> assert_equal ( cs . x , <NUM_LIT:0.0> ) <EOL> assert_equal ( cs . y , <NUM_LIT:0.1> ) <EOL> assert_equal ( cs . i , <NUM_LIT> ) <EOL> assert_equal ( cs . j , <NUM_LIT> ) <EOL> assert_equal ( cs . op , '<STR_LIT>' ) <EOL> def test_coordstmt_dump ( ) : <EOL> cs = CoordStmt ( '<STR_LIT>' , <NUM_LIT:0.0> , <NUM_LIT:0.1> , <NUM_LIT> , <NUM_LIT> , '<STR_LIT>' , FileSettings ( ) ) <EOL> assert_equal ( cs . to_gerber ( FileSettings ( ) ) , '<STR_LIT>' ) <EOL> def test_coordstmt_conversion ( ) : <EOL> cs = CoordStmt ( '<STR_LIT>' , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , '<STR_LIT>' , FileSettings ( ) ) <EOL> cs . units = '<STR_LIT>' <EOL> cs . to_metric ( ) <EOL> assert_equal ( cs . x , <NUM_LIT> ) <EOL> assert_equal ( cs . y , <NUM_LIT> ) <EOL> assert_equal ( cs . i , <NUM_LIT> ) <EOL> assert_equal ( cs . j , <NUM_LIT> ) <EOL> assert_equal ( cs . function , '<STR_LIT>' ) <EOL> cs . to_inch ( ) <EOL> assert_equal ( cs . units , '<STR_LIT>' ) <EOL> assert_equal ( cs . x , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . y , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . i , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . j , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . function , '<STR_LIT>' ) <EOL> cs . to_inch ( ) <EOL> assert_equal ( cs . x , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . y , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . i , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . j , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . function , '<STR_LIT>' ) <EOL> cs = CoordStmt ( '<STR_LIT>' , <NUM_LIT:1.> , <NUM_LIT:1.> , <NUM_LIT:1.> , <NUM_LIT:1.> , '<STR_LIT>' , FileSettings ( ) ) <EOL> cs . units = '<STR_LIT>' <EOL> cs . to_inch ( ) <EOL> assert_equal ( cs . x , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . y , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . i , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . j , <NUM_LIT:1.> ) <EOL> assert_equal ( cs . function , '<STR_LIT>' ) <EOL> cs . to_metric ( ) <EOL> assert_equal ( cs . x , <NUM_LIT> ) <EOL> assert_equal ( cs . y , <NUM_LIT> ) <EOL> assert_equal ( cs . i , <NUM_LIT> ) <EOL> assert_equal ( cs . j , <NUM_LIT> ) <EOL> assert_equal ( cs . function , '<STR_LIT>' ) <EOL> cs . to_metric ( ) <EOL> assert_equal ( cs . x , <NUM_LIT> ) <EOL> assert_equal ( cs . y , <NUM_LIT> ) <EOL> assert_equal ( cs . i , <NUM_LIT> ) <EOL> assert_equal ( cs . j , <NUM_LIT> ) <EOL> assert_equal ( cs . function , '<STR_LIT>' ) <EOL> def test_coordstmt_offset ( ) : <EOL> c = CoordStmt ( '<STR_LIT>' , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , '<STR_LIT>' , FileSettings ( ) ) <EOL> c . offset ( <NUM_LIT:1> , <NUM_LIT:0> ) <EOL> assert_equal ( c . x , <NUM_LIT:1.> ) <EOL> assert_equal ( c . y , <NUM_LIT:0.> ) <EOL> assert_equal ( c . i , <NUM_LIT:1.> ) <EOL> assert_equal ( c . j , <NUM_LIT:0.> ) <EOL> c . offset ( <NUM_LIT:0> , <NUM_LIT:1> ) <EOL> assert_equal ( c . x , <NUM_LIT:1.> ) <EOL> assert_equal ( c . y , <NUM_LIT:1.> ) <EOL> assert_equal ( c . i , <NUM_LIT:1.> ) <EOL> assert_equal ( c . j , <NUM_LIT:1.> ) <EOL> def test_coordstmt_string ( ) : <EOL> cs = CoordStmt ( '<STR_LIT>' , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , '<STR_LIT>' , FileSettings ( ) ) <EOL> assert_equal ( str ( cs ) , <EOL> '<STR_LIT>' ) <EOL> cs = CoordStmt ( '<STR_LIT>' , None , None , None , None , '<STR_LIT>' , FileSettings ( ) ) <EOL> assert_equal ( str ( cs ) , '<STR_LIT>' ) <EOL> cs = CoordStmt ( '<STR_LIT>' , None , None , None , None , '<STR_LIT>' , FileSettings ( ) ) <EOL> assert_equal ( str ( cs ) , '<STR_LIT>' ) <EOL> cs = CoordStmt ( '<STR_LIT>' , None , None , None , None , '<STR_LIT>' , FileSettings ( ) ) <EOL> assert_equal ( str ( cs ) , '<STR_LIT>' ) <EOL> def test_aperturestmt_ctor ( ) : <EOL> ast = ApertureStmt ( <NUM_LIT:3> , False ) <EOL> assert_equal ( ast . d , <NUM_LIT:3> ) <EOL> assert_equal ( ast . deprecated , False ) <EOL> ast = ApertureStmt ( <NUM_LIT:4> , True ) <EOL> assert_equal ( ast . d , <NUM_LIT:4> ) <EOL> assert_equal ( ast . deprecated , True ) <EOL> ast = ApertureStmt ( <NUM_LIT:4> , <NUM_LIT:1> ) <EOL> assert_equal ( ast . d , <NUM_LIT:4> ) <EOL> assert_equal ( ast . deprecated , True ) <EOL> ast = ApertureStmt ( <NUM_LIT:3> ) <EOL> assert_equal ( ast . d , <NUM_LIT:3> ) <EOL> assert_equal ( ast . deprecated , False ) <EOL> def test_aperturestmt_dump ( ) : <EOL> ast = ApertureStmt ( <NUM_LIT:3> , False ) <EOL> assert_equal ( ast . to_gerber ( ) , '<STR_LIT>' ) <EOL> ast = ApertureStmt ( <NUM_LIT:3> , True ) <EOL> assert_equal ( ast . to_gerber ( ) , '<STR_LIT>' ) <EOL> assert_equal ( str ( ast ) , '<STR_LIT>' ) </s>
