I just wanna create a class
definition with a static field with a name. A file called exercises.py
contains:
First error:
FAIL: test_00_packages (__main__.Ex00)
Traceback (most recent call last):
File "ex00.py", line 55, in test_00_packages
self.assertTrue("Exercise00" in globals())
AssertionError: False is not true
Later:
class Exercise00:
def __init__(self, STUDENT_NAME):
self.STUDENT_NAME = 'Name Name'
But if I try to print Exercise00.STUDENT_NAME
I just get
NameError: name 'Exercise00' is not defined
But I guess I defined it?!
Here the complete error:
ERROR: test_01_static_field (__main__.Ex00)
----------------------------------------------------------------------
Traceback (most recent call last):
File "ex00.py", line 60, in test_01_static_field
print("[I] Name: " + Exercise00.STUDENT_NAME)
NameError: name 'Exercise00' is not defined
----------------------------------------------------------------------
My task is to create a class
called Exercise00
with a static field STUDENT_NAME
.
The line in ex00.py is:
def test_00_packages(self):
self.assertTrue("Exercise00" in globals())