forked from VaclavTomanik/hello_git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
21 lines (16 loc) · 754 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import unittest
import importlib
import os
class TestMessages(unittest.TestCase):
def test_student_messages(self):
# Path to the 'lide' directory
lide_dir = os.path.join(os.path.dirname(__file__), 'lide')
# Iterate over all files in the 'lide' directory
for filename in os.listdir(lide_dir):
if filename.endswith('.py'):
module_name = f'lide.{filename[:-3]}'
module = importlib.import_module(module_name)
# Check if the module has a function named 'muj_pozdrav'
self.assertTrue(hasattr(module, 'muj_pozdrav'), f"{module_name} does not have a function 'muj_pozdrav'")
if __name__ == '__main__':
unittest.main()