def test_redeem(): r = Redeem("/usr/src/redeem/configs") g = r.printer.processor for gcode in g.get_test_gcodes(): logging.info("Testing '"+gcode.message+"'") g.execute(gcode) r.exit() pass
def test_redeem(): r = Redeem() g = r.printer.processor for gcode in g.get_test_gcodes(): logging.info("Testing '" + gcode.message + "'") g.execute(gcode) r.exit() pass
def test_redeem(): r = Redeem("/usr/src/redeem/configs") r.printer.enable.set_enabled() g = r.printer.processor for gcode in g.get_test_gcodes(): logging.info("Testing '" + gcode.message + "'") g.execute(gcode) r.exit() pass
def test_code(test_str): r = Redeem("/usr/src/redeem/configs") g = r.printer.processor for line in test_str.splitlines(): if line: print line g.execute( Gcode({"message": line, "prot":"testing"}) ) r.exit()
def test_code(test_str): r = Redeem("/usr/src/redeem/configs") r.printer.enable.set_enabled() g = r.printer.processor for line in test_str.splitlines(): if line: print line g.execute(Gcode({"message": line, "prot": "testing"})) r.exit()
def test_file(test): r = Redeem("/usr/src/redeem/configs") r.printer.enable.set_enabled() g = r.printer.processor f = open(test, 'r') for line in f.readlines(): if line: print line g.execute(Gcode({"message": line, "prot": "testing"})) r.exit() f.close()
def test4(): test_str = """ G28 G1 F5000.000 G1 Z0.350 G1 X-100.0 Y-100.0 G1 X100.0 Y-100.0 G1 X100.0 Y100.0 G1 X-100.0 Y100.0 G1 X0.0 Y0.0 """ r = Redeem() g = r.printer.processor for line in test_str.splitlines(): if line: print line g.execute(Gcode({"message": line, "prot": "testing"})) r.exit()
def test4(): test_str = """ G28 G1 F5000.000 G1 Z0.350 G1 X-100.0 Y-100.0 G1 X100.0 Y-100.0 G1 X100.0 Y100.0 G1 X-100.0 Y100.0 G1 X0.0 Y0.0 """ r = Redeem() g = r.printer.processor for line in test_str.splitlines(): if line: print line g.execute( Gcode({"message": line, "prot":"testing"}) ) r.exit()
def setUpClass(cls, mock_init_path_planner): """ Allow Extruder or HBP instantiation without crashing 'cause not BBB/Replicape """ def disabled_extruder_enable(self): self.avg = 1 self.temperatures = [100] pass def disabled_hbp_enable(self): pass def bypass_init_path_planner(self): pass mock.patch('redeem.Extruder.Extruder.enable', new=disabled_extruder_enable).start() mock.patch('redeem.Extruder.HBP.enable', new=disabled_hbp_enable).start() mock.patch('redeem.PathPlanner.PathPlanner._init_path_planner', new=bypass_init_path_planner) cls.temporary_config_directory = tempfile.mkdtemp() cls.setUpConfigFiles(cls.temporary_config_directory) cls.R = Redeem(config_location=cls.temporary_config_directory) cls.printer = cls.R.printer cls.printer.config.replicape_key = "TESTING_DUMMY_KEY" cls.setUpPatch() cls.gcodes = cls.printer.processor.gcodes cls.printer.send_message = mock.create_autospec( cls.printer.send_message) cls.printer.movement = Path.ABSOLUTE cls.printer.feed_rate = 0.050 # m/s cls.printer.accel = 0.050 / 60 # m/s/s Gcode.printer = cls.printer Path.printer = cls.printer cls.printer.speed_factor = 1.0 """ We want to ensure that printer.factor is always obeyed correctly For convenience, we'll set it to mm/inch and check that resulting paths have the correct meter values, converted from inch input. """ cls.printer.unit_factor = cls.f = 25.4 # inches cls.printer.probe_points = []
def test_load(): r = Redeem("/usr/src/redeem/configs") r.exit()
def test2(): r = Redeem() g = r.printer.processor g.execute(Gcode({"message": "G28", "prot": "testing"})) r.exit()
def test2(): r = Redeem() g = r.printer.processor g.execute( Gcode({"message": "G28", "prot": "testing"}) ) r.exit()