-
Notifications
You must be signed in to change notification settings - Fork 0
Tester
Tianshu Huang edited this page Dec 3, 2018
·
1 revision
Simply run
python tests.pyfrom the main r5-2019 directory.
At the bottom of tests.py, add the module as an import and to the list passed to run_tests:
import control
import your_new_module
run_tests([control, your_new_module])Add tests by adding a unittest.TestCase class to any file imported by your module. This class should then contain methods that start with test, which will be run. For example:
class Tests(unittest.TestCase):
def test_foo(self):
self.assertEqual(run_test_function(1), 0)
self.assertTrue(1 == 1)
self.assertFalse(1 == 2)