common: fix __repr__ on AttributeHolder

This commit is contained in:
Roman Zeyde
2015-01-16 10:51:11 +02:00
parent b4dc0922eb
commit cb8ce9e8ec
2 changed files with 11 additions and 1 deletions

View File

@@ -51,3 +51,11 @@ def test_izip():
x = range(10)
y = range(-10, 0)
assert list(common.izip([x, y])) == list(zip(x, y))
def test_holder():
d = {'x': 1, 'y': 2.3}
a = common.AttributeHolder(d)
assert a.x == d['x']
assert a.y == d['y']
assert repr(a) == 'AttributeHolder(x=1, y=2.3)'