[Zope-CVS] CVS: Products/AdaptableStorage/tests - testZope2FS.py:1.10
Shane Hathaway
shane@zope.com
Fri, 3 Jan 2003 17:04:26 -0500
Update of /cvs-repository/Products/AdaptableStorage/tests
In directory cvs.zope.org:/tmp/cvs-serv20380/tests
Modified Files:
testZope2FS.py
Log Message:
Added PropertyManager support.
=== Products/AdaptableStorage/tests/testZope2FS.py 1.9 => 1.10 ===
--- Products/AdaptableStorage/tests/testZope2FS.py:1.9 Tue Dec 31 16:09:05 2002
+++ Products/AdaptableStorage/tests/testZope2FS.py Fri Jan 3 17:04:24 2003
@@ -203,6 +203,44 @@
conn.close()
+ def testStoreProperties(self):
+ conn = self.db.open()
+ try:
+ app = conn.root()['Application']
+ f = Folder()
+ f.id = 'Holidays'
+ f.title = 'Holiday Calendar'
+ app._setObject(f.id, f, set_owner=0)
+ get_transaction().commit()
+
+ f._setProperty('pi', 3.14, 'float')
+ f._setProperty('stuff', ['a', 'bc', 'd'], 'lines')
+ get_transaction().commit()
+
+ conn2 = self.db.open()
+ try:
+ app = conn2.root()['Application']
+ self.assert_(hasattr(app, 'Holidays'))
+ got = 0
+ for k, v in app.Holidays.propertyItems():
+ if k == 'title':
+ got += 1
+ self.assertEqual(v, 'Holiday Calendar')
+ elif k == 'pi':
+ got += 1
+ self.assertEqual(v, 3.14)
+ elif k == 'stuff':
+ got += 1
+ self.assertEqual(v, ['a', 'bc', 'd'])
+ self.assertEqual(got, 3)
+ finally:
+ conn2.close()
+
+ finally:
+ conn.close()
+
+
+
class Zope2FSUnderscoreTests (Zope2FSTests):
def _createMapper(self, path):