added testing
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
|
||||
import unittest
|
||||
|
||||
class TestImportPackage(unittest.TestCase):
|
||||
def test_import_main_package(self):
|
||||
try:
|
||||
import motionFunctionsLib
|
||||
except Exception as e:
|
||||
self.fail(f"Importing your_package_name failed: {e}")
|
||||
|
||||
|
||||
def test_has_expected_attributes(self):
|
||||
import motionFunctionsLib
|
||||
for attr in ["plc", "E_MotionFunctions", "E_HomingRoutines", "E_PneumaticAxisErrors"]:
|
||||
with self.subTest(attr=attr):
|
||||
self.assertTrue(
|
||||
hasattr(motionFunctionsLib, attr),
|
||||
f"{attr} not found in motionFunctionsLib"
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user