8000 tweak the tests · liang324/robotics-toolbox-python@d8f2c2c · GitHub
[go: up one dir, main page]

Skip to content

Commit d8f2c2c

Browse files
committed
tweak the tests
1 parent 4461a5d commit d8f2c2c

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

tests/test_ELink.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,16 @@ def test_dyn(self):
145145

146146
self.assertEqual(
147147
s0,
148-
"m = 0.00 \n"
149-
"r = 0.00 0.00 0.00 \n"
150-
" | 0.00 0.00 0.00 | \n"
151-
"I = | 0.00 0.35 0.00 | \n"
152-
" | 0.00 0.00 0.00 | \n"
153-
"Jm = 0.00 \n"
154-
"B = 0.00 \n"
155-
"Tc = 0.40(+) -0.43(-) \n"
156-
"G = -62.61 \n"
157-
"qlim = -2.79 to 2.79")
148+
"""m = 0
149+
r = 0 0 0
150+
| 0 0 0 |
151+
I = | 0 0.35 0 |
152+
| 0 0 0 |
153+
Jm = 0
154+
B = 0
155+
Tc = 0.4(+) -0.43(-)
156+
G = -63
157+
qlim = -2.8 to 2.8""")
158158

159159
def test_properties(self):
160160
l0 = rp.ELink()

tests/test_Link.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,24 @@ def test_setB(self):
190190
with self.assertRaises(TypeError):
191191
l0.B = [1, 2]
192192

193+
def test_robot(self):
194+
l0 = rp.RevoluteDH()
195+
r = rp.Robot([l0])
196+
197+
self.assertIs(l0._robot, r)
198+
199+
def test_copy(self):
200+
201+
l0 = rp.RevoluteDH()
202+
r = rp.Robot([l0])
203+
l1 = l0.copy()
204+
l0.m = 4
205+
l0.r[1] = 5
206+
self.assertEqual(l1.m, 0)
207+
self.assertEqual(l1.r[1], 0)
208+
self.assertIs(l0._robot, r)
209+
self.assertIs(l1._robot, r)
210+
193211
if __name__ == '__main__':
194212

195213
unittest.main()

0 commit comments

Comments
 (0)
0