tests/object_dict.py: Add test for obj.__dict__ .

This commit is contained in:
Paul Sokolovsky 2016-01-03 20:51:36 +02:00
parent 3c014a67ea
commit ee7b8f32e3
1 changed files with 14 additions and 0 deletions

View File

@ -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'})