22 lines
682 B
Python
22 lines
682 B
Python
|
|
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() |