Commit 81931dba authored by Andreas Jung's avatar Andreas Jung

added check for keys() called with arguments

parent 521656b0
...@@ -146,6 +146,7 @@ class MappingBase(Base): ...@@ -146,6 +146,7 @@ class MappingBase(Base):
for i in range(100): for i in range(100):
assert v[i]==i*i , (i*i,i) assert v[i]==i*i , (i*i,i)
def testKeysWorks(self): def testKeysWorks(self):
for x in range(100): for x in range(100):
...@@ -153,8 +154,13 @@ class MappingBase(Base): ...@@ -153,8 +154,13 @@ class MappingBase(Base):
v = self.t.keys() v = self.t.keys()
i = 0 i = 0
for x in v: for x in v:
assert x == i, (x,i) self.assertEqual(x,i)
i = i + 1 i = i + 1
for x in range(40):
lst = self.t.keys(0+x,99-x)
self.assertEqual(list(lst),range(0+x,99-x+1))
# BTree items must lie about their lengths, so we convert to list # BTree items must lie about their lengths, so we convert to list
assert len(v) == 100, len(v) assert len(v) == 100, len(v)
#assert len(v) == 100, len(v) #assert len(v) == 100, len(v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment