def test_precision(): """makes sure that gcode are equals if the numeric values are similar enough and different is the numeric values are far enough""" gcode_eq(open_gcode_file('simple1.gcode'), open_gcode_file('simple1_equivalent.gcode')) assert_not_equal(open_gcode_file('simple1.gcode'), open_gcode_file('simple1_slightly_different.gcode'))
def test_nop_move(): gcode = open_gcode_file('simple1.gcode') gcode_oracle = open_gcode_file('simple1.gcode') GCodeXYTranslateFilter(x=0, y=0).filter(gcode) gcode_eq(gcode_oracle, gcode)
def test_skeinforge_formatted_stretch(): gcode_oracle = open_gcode_file('skeinforge_model1_poststretch.gcode') gcode = open_gcode_file('skeinforge_model1_prestretch.gcode') SkeinforgeStretchFilter().filter(gcode) gcode_eq(gcode_oracle, gcode)
def test_nop_relative_extrusion(): gcode = open_gcode_file('simple1.gcode') gcode_oracle = open_gcode_file('simple1.gcode') GCodeToRelativeExtrusionFilter().filter(gcode) gcode_eq(gcode_oracle, gcode)
def test_trivial_relative_extrusion(): gcode = open_gcode_file('simple3.gcode') gcode_oracle = open_gcode_file('simple3-relative.gcode') GCodeToRelativeExtrusionFilter().filter(gcode) gcode_eq(gcode_oracle, gcode)
def test_trivial_move(): gcode = open_gcode_file('simple1.gcode') gcode_oracle = open_gcode_file('simple2.gcode') GCodeXYTranslateFilter(x=1, y=2).filter(gcode) gcode_eq(gcode_oracle, gcode)
def test_identity_equality(): gcode_eq(open_gcode_file('simple1.gcode'), open_gcode_file('simple1.gcode'))
def test_ignore_non_command(): gcode_eq(open_gcode_file('empty_for_good.gcode'), open_gcode_file('empty_skeinforge_format.gcode'))
def test_arc_optimization_4(): gcode = open_gcode_file('arc_raw_4.gcode') gcode_ref = open_gcode_file('arc_ref_4.gcode') logging.basicConfig(level=logging.DEBUG) GCodeArcOptimizerFilter().filter(gcode) gcode_eq(gcode_ref, gcode)