Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improved unit test suggestd by ben greiner
  • Loading branch information
sawyerbfuller committed Jul 20, 2020
commit c96465dcaa36431d55335f086326c4a23f00bc9f
19 changes: 12 additions & 7 deletions control/tests/discrete_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,18 @@ def test_timebase_conversions(self):
self.assertEqual(timebase(feedback(tf3, tf4)), timebase(tf4))

# Make sure all other combinations are errors
self.assertRaises(ValueError, tf2.__mul__, tf3)
self.assertRaises(ValueError, tf2.__mul__, tf4)
self.assertRaises(ValueError, tf2.__add__, tf3)
self.assertRaises(ValueError, tf2.__add__, tf4)
self.assertRaises(ValueError, tf2.feedback, tf3)
self.assertRaises(ValueError, tf2.feedback, tf4)

with self.assertRaises(ValueError): tf2*tf3
with self.assertRaises(ValueError): tf3*tf2
with self.assertRaises(ValueError): tf2*tf4
with self.assertRaises(ValueError): tf4*tf2
with self.assertRaises(ValueError): tf2+tf3
with self.assertRaises(ValueError): tf3+tf2
with self.assertRaises(ValueError): tf2+tf4
with self.assertRaises(ValueError): tf4+tf2
with self.assertRaises(ValueError): feedback(tf2, tf3)
with self.assertRaises(ValueError): feedback(tf3, tf2)
with self.assertRaises(ValueError): feedback(tf2, tf4)
with self.assertRaises(ValueError): feedback(tf4, tf2)

def testisdtime(self):
# Constant
Expand Down