Commit 11d19234 authored by Jim Fulton's avatar Jim Fulton

Need to normalize lists (with list()) when compating keys/items/etc.

Rewrote suite building to use a test_suite function as required by
Brian's test runner.

Added a debug function and a new __main__ handler that can run it.
parent 0ddef194
...@@ -666,7 +666,7 @@ class TestOIBuckets(BucketTests, TestCase): ...@@ -666,7 +666,7 @@ class TestOIBuckets(BucketTests, TestCase):
def setUp(self): def setUp(self):
self.t = OIBucket() self.t = OIBucket()
def main(): def test_suite():
TIOBTree = makeSuite(TestIOBTrees, 'test') TIOBTree = makeSuite(TestIOBTrees, 'test')
TOOBTree = makeSuite(TestOOBTrees, 'test') TOOBTree = makeSuite(TestOOBTrees, 'test')
TOIBTree = makeSuite(TestOIBTrees, 'test') TOIBTree = makeSuite(TestOIBTrees, 'test')
...@@ -691,19 +691,33 @@ def main(): ...@@ -691,19 +691,33 @@ def main():
TIOTreeSet, TOOTreeSet, TOITreeSet, TIITreeSet, TIOTreeSet, TOOTreeSet, TOITreeSet, TIITreeSet,
TIOBucket, TOOBucket, TOIBucket, TIIBucket, TIOBucket, TOOBucket, TOIBucket, TIIBucket,
TOOBTree, TIOBTree, TOIBTree, TIIBTree)) TOOBTree, TIOBTree, TOIBTree, TIIBTree))
return alltests
def main():
alltests=test_suite()
runner = TextTestRunner() runner = TextTestRunner()
runner.run(alltests) runner.run(alltests)
def debug():
test_suite().debug()
## utility functions ## utility functions
def lsubtract(l1, l2): def lsubtract(l1, l2):
l = filter(lambda x, l1=l1: x not in l1, l2) l1=list(l1)
l = l + filter(lambda x, l2=l2: x not in l2, l1) l2=list(l2)
return l l = filter(lambda x, l1=l1: x not in l1, l2)
l = l + filter(lambda x, l2=l2: x not in l2, l1)
return l
def realseq(itemsob): def realseq(itemsob):
return map(lambda x: x, itemsob) return map(lambda x: x, itemsob)
if __name__=='__main__':
if __name__ == '__main__': main() if len(sys.argv) > 1:
globals()[sys.argv[1]]()
else:
main()
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