tests/object_dict.py: Add test for obj.__dict__ .
This commit is contained in:
parent
3c014a67ea
commit
ee7b8f32e3
|
@ -0,0 +1,14 @@
|
|||
import sys
|
||||
|
||||
class Foo:
|
||||
|
||||
def __init__(self):
|
||||
self.a = 1
|
||||
self.b = "bar"
|
||||
|
||||
o = Foo()
|
||||
if not hasattr(o, "__dict__"):
|
||||
print("SKIP")
|
||||
sys.exit()
|
||||
|
||||
print(o.__dict__ == {'a': 1, 'b': 'bar'})
|
Loading…
Reference in New Issue