-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
44 lines (30 loc) · 676 Bytes
/
tests.py
File metadata and controls
44 lines (30 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# -*- coding: utf-8 -*-
from py2gcode import *
import unittest
class TestGCodes(unittest.TestCase):
def setUp(self):
pass
def test_G0(self):
clearCNC()
f = cnc(lambda: G0(X=1))
res = f()
self.assertTrue(res == "G0 X1")
clearCNC()
f = cnc(lambda: G0(X=1, Y=2, Z=3))
self.assertTrue(f() == "G0 X1 Y2 Z3")
def test_G1(self):
clearCNC()
f = cnc(lambda: G1(X=1))
res = f()
self.assertTrue(res == "G1 X1")
clearCNC()
f = cnc(lambda: G1(X=1, Y=2, Z=3))
self.assertTrue(f() == "G1 X1 Y2 Z3")
if __name__ == '__main__':
unittest.main()
'''
@cnc
def f():
G0(X=0)
print f()
'''