We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 690af61 commit 23c5f70Copy full SHA for 23c5f70
Week01/test_info.py
@@ -0,0 +1,25 @@
1
+import os
2
+
3
4
+files = [f for f in os.listdir(os.path.dirname(__file__)) if f.startswith("info")]
5
+for f in files:
6
+ exec("import " + f[:-3] + " as " + f[:-3])
7
+ print(f"The module {f[:-3]} has been imported.")
8
9
10
+def test_names():
11
+ for f in files:
12
+ assert "student_id" in dir(eval(f[:-3])), (
13
+ "student_id is not defined in " + f[:-3]
14
+ )
15
+ assert "full_name" in dir(eval(f[:-3])), "full_name is not defined in " + f[:-3]
16
17
18
+def test_types():
19
20
+ assert isinstance(eval(f[:-3]).student_id, str), (
21
+ "student_id is not a string in " + f[:-3]
22
23
+ assert isinstance(eval(f[:-3]).full_name, str), (
24
+ "full_name is not a string in " + f[:-3]
25
0 commit comments