

@pytest.mark.parametrize('i', range(10))
def test_simple_size_estimation(self, space, i):
    class_node = mapdict.ClassNode(i)
    assert (class_node.size_estimate.object_size_estimate() == 0)
    assert (class_node.size_estimate.unboxed_size_estimate() == 0)
    for j in range(1000):
        w_obj = FakeObject(class_node)
        for a in 'abcdefghij'[:i]:
            w_obj.map = w_obj.map.add(space, mapdict.ObjectAttributeNode, a, w_obj)
    assert (class_node.size_estimate.object_size_estimate() == i)
    assert (class_node.size_estimate.unboxed_size_estimate() == 0)

dataset/ETHPy150Open topazproject/topaz/tests/test_mapdict.py TestMapDict.test_simple_size_estimation/original