[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/container/tests/test_icontainer.py
Made general IContainer tests runnable for containers not supporting
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Jul 6 14:36:29 EDT 2004
Log message for revision 26115:
Made general IContainer tests runnable for containers not supporting
string-based keys.
XXX: These tests still need more work to generalize them, as the entire
API does. I eventually gave up trying to manage bug ids as integers.
-=-
Modified: Zope3/trunk/src/zope/app/container/tests/test_icontainer.py
===================================================================
--- Zope3/trunk/src/zope/app/container/tests/test_icontainer.py 2004-07-06 18:34:53 UTC (rev 26114)
+++ Zope3/trunk/src/zope/app/container/tests/test_icontainer.py 2004-07-06 18:36:29 UTC (rev 26115)
@@ -171,18 +171,18 @@
data = self.makeTestData()
foo = data[0][1]
- folder['foo'] = foo
- name = 'foo'
+ name = data[0][0]
+ folder[name] = foo
self.assertEquals(len(folder.keys()), 1)
- self.assertEquals(folder.keys()[0], 'foo')
+ self.assertEquals(folder.keys()[0], name)
self.assertEquals(len(folder.values()), 1)
self.assertEquals(folder.values()[0], foo)
self.assertEquals(len(folder.items()), 1)
- self.assertEquals(folder.items()[0], ('foo', foo))
+ self.assertEquals(folder.items()[0], (name, foo))
self.assertEquals(len(folder), 1)
- self.failUnless('foo' in folder)
+ self.failUnless(name in folder)
# Use an arbitrary id frpm the data set; don;t just use any id, since
# there might be restrictions on their form
self.failIf(data[6][0] in folder)
@@ -194,7 +194,7 @@
foo2 = data[1][1]
- name2 = 'foo2'
+ name2 = data[1][0]
folder[name2] = foo2
self.assertEquals(len(folder.keys()), 2)
@@ -222,14 +222,14 @@
folder = self.makeTestObject()
data = self.makeTestData()
objects = [ data[i][1] for i in range(4) ]
- name0 = 'foo'
- name1 = 'bar'
- name2 = 'baz'
- name3 = 'bam'
- folder['foo'] = objects[0]
- folder['bar'] = objects[1]
- folder['baz'] = objects[2]
- folder['bam'] = objects[3]
+ name0 = data[0][0]
+ name1 = data[1][0]
+ name2 = data[2][0]
+ name3 = data[3][0]
+ folder[name0] = objects[0]
+ folder[name1] = objects[1]
+ folder[name2] = objects[2]
+ folder[name3] = objects[3]
self.assertEquals(len(folder.keys()), len(objects))
self.failUnless(name0 in folder.keys())
More information about the Zope3-Checkins
mailing list