<s> import os <EOL> from . . rs274x import read , GerberFile <EOL> from . tests import * <EOL> TOP_COPPER_FILE = os . path . join ( os . path . dirname ( __file__ ) , <EOL> '<STR_LIT>' ) <EOL> MULTILINE_READ_FILE = os . path . join ( os . path . dirname ( __file__ ) , <EOL> '<STR_LIT>' ) <EOL> def test_read ( ) : <EOL> top_copper = read ( TOP_COPPER_FILE ) <EOL> assert ( isinstance ( top_copper , GerberFile ) ) <EOL> def test_multiline_read ( ) : <EOL> multiline = read ( MULTILINE_READ_FILE ) <EOL> assert ( isinstance ( multiline , GerberFile ) ) <EOL> assert_equal ( <NUM_LIT:10> , len ( multiline . statements ) ) <EOL> def test_comments_parameter ( ) : <EOL> top_copper = read ( TOP_COPPER_FILE ) <EOL> assert_equal ( top_copper . comments [ <NUM_LIT:0> ] , '<STR_LIT>' ) <EOL> def test_size_parameter ( ) : <EOL> top_copper = read ( TOP_COPPER_FILE ) <EOL> size = top_copper . size <EOL> assert_almost_equal ( size [ <NUM_LIT:0> ] , <NUM_LIT> , <NUM_LIT:6> ) <EOL> assert_almost_equal ( size [ <NUM_LIT:1> ] , <NUM_LIT> , <NUM_LIT:6> ) <EOL> def test_conversion ( ) : <EOL> import copy <EOL> top_copper = read ( TOP_COPPER_FILE ) <EOL> assert_equal ( top_copper . units , '<STR_LIT>' ) <EOL> top_copper_inch = copy . deepcopy ( top_copper ) <EOL> top_copper . to_metric ( ) <EOL> for statement in top_copper_inch . statements : <EOL> statement . to_metric ( ) <EOL> for primitive in top_copper_inch . primitives : <EOL> primitive . to_metric ( ) <EOL> assert_equal ( top_copper . units , '<STR_LIT>' ) <EOL> for i , m in zip ( top_copper . statements , top_copper_inch . statements ) : <EOL> assert_equal ( i , m ) <EOL> for i , m in zip ( top_copper . primitives , top_copper_inch . primitives ) : <EOL> assert_equal ( i , m ) </s>
