commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r8461 - trunk/gnue-appserver/tests


From: reinhard
Subject: [gnue] r8461 - trunk/gnue-appserver/tests
Date: Mon, 15 May 2006 04:07:49 -0500 (CDT)

Author: reinhard
Date: 2006-05-15 04:07:49 -0500 (Mon, 15 May 2006)
New Revision: 8461

Modified:
   trunk/gnue-appserver/tests/data.py
Log:
Fixed unittest for new interface.


Modified: trunk/gnue-appserver/tests/data.py
===================================================================
--- trunk/gnue-appserver/tests/data.py  2006-05-15 09:07:22 UTC (rev 8460)
+++ trunk/gnue-appserver/tests/data.py  2006-05-15 09:07:49 UTC (rev 8461)
@@ -62,7 +62,7 @@
 
     # Write data into clean cache. The cache should not be dirty at all
     for row in rows:
-      self.cache.write (table, row, u'foo', 1, False)
+      self.cache.write_clean (table, row, [(u'foo', 1)])
 
     result = self.__orderTables (self.cache.dirtyTables ())
     self.assertEqual (result, [])
@@ -71,13 +71,13 @@
 
     # Now write data to dirty cache, which will render the records as 'changed'
     for row in rows:
-      self.cache.write (table, row, u'foo', 1, True)
+      self.cache.write_dirty (table, row, u'foo', 1)
 
     self.cache.insertRecord (u'BAR', u'200')
     self.cache.initialized (u'BAR', u'200')
     self.cache.insertRecord (u'FOO', u'771')
     self.cache.initialized (u'FOO', u'771')
-    self.cache.write (u'FOO', u'771', u'val', 5, True)
+    self.cache.write_dirty (u'FOO', u'771', u'val', 5)
 
     result = self.__orderTables (self.cache.dirtyTables ())
     exp = [(u'BAR', u'200', 'initialized', [(u'gnue_id', u'200')]),
@@ -105,7 +105,7 @@
 
     self.cache.insertRecord (table, u'1')
     self.cache.initialized (table, u'1')
-    self.cache.write (table, u'1', u'foo', 1, True)
+    self.cache.write_dirty (table, u'1', u'foo', 1)
 
     self.cache.insertRecord (table, u'2')
     self.cache.initialized (table, u'2')
@@ -147,7 +147,7 @@
     row2  = u'200'
 
     # We cannot insert a record if it's already available
-    self.cache.write (table, row, u'foo', 1, True)
+    self.cache.write_dirty (table, row, u'foo', 1)
     self.assertRaises (data.DuplicateRecordError, self.cache.insertRecord,
         table, row)
 
@@ -156,7 +156,7 @@
     # Insert a record, change and confirm it
     self.cache.insertRecord (table, row)
     self.cache.initialized (table, row)
-    self.cache.write (table, row, u'foo', 1, True)
+    self.cache.write_dirty (table, row, u'foo', 1)
     self.cache.confirm ()
 
     result = self.__orderTables (self.cache.dirtyTables ())
@@ -167,9 +167,9 @@
 
     # change it again, and insert another row. We won't set the latter one to
     # initialized so it does not get into 'inserted' state
-    self.cache.write (table, row, u'foo', 2, True)
+    self.cache.write_dirty (table, row, u'foo', 2)
     self.cache.insertRecord (table, row2)
-    self.cache.write (table, row2, u'bar', 2, True)
+    self.cache.write_dirty (table, row2, u'bar', 2)
 
     result = self.__orderTables (self.cache.dirtyTables ())
     exp = [(table, row, 'inserted', [(u'foo', 2), (u'gnue_id', row)]),
@@ -214,7 +214,7 @@
 
     self.cache.insertRecord (table, row)
     self.cache.initialized (table, row)
-    self.cache.write (table, row, u'name', 'foobar', True)
+    self.cache.write_dirty (table, row, u'name', 'foobar')
     self.cache.confirm ()
 
     exp = [(table, row, 'inserted', [(u'gnue_id', row), (u'name', 'foobar')])]
@@ -246,11 +246,11 @@
     row   = u'100'
 
     # First add some clean data to the cache
-    self.cache.write (table, row, u'foo', 1, False)
+    self.cache.write_clean (table, row, [(u'foo', 1)])
 
     # Now change an 'existing' record and cancel that operation
-    self.cache.write (table, row, u'bar', 2, True)
-    self.cache.write (table, row, u'foo', 100, True)
+    self.cache.write_dirty (table, row, u'bar', 2)
+    self.cache.write_dirty (table, row, u'foo', 100)
     self.cache.cancel ()
 
     # The cached (current) value of 'foo' should be still the clean value, and
@@ -259,7 +259,7 @@
     self.assertEqual (self.cache.dirtyTables (), {})
 
     # Change the record again; now it should have the state 'changed'
-    self.cache.write (table, row, u'foo', 100, True)
+    self.cache.write_dirty (table, row, u'foo', 100)
     result = self.__orderTables (self.cache.dirtyTables ())
     exp = [(table, row, 'changed', [(u'foo', 100)])]
     self.assertEqual (result, exp)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]