示例#1
0
def test_repr():
    g = GCode.from_string(COMMAND)
    assert str(g) == "G01 X00 Y-0.1 (comment1) ;comment2"
示例#2
0
def test_get_word():
    g = GCode.from_string(COMMAND)
    result = g.get_code_word("X")
    assert result == ("X", 0.0)
    result = g.get_code_word("Z")
    assert result is None
示例#3
0
def test_get_position():
    g = GCode.from_string(COMMAND)
    position = g.get_position()
    assert position == {"X": 0, "Y": -0.1}
示例#4
0
def test_gcode_parse():
    g = GCode.from_string(COMMAND)
    assert g == GCODE