예제 #1
0
 def _writeSingleTest(self, key, data):
     t = Transaction()
     
     t.write(str(self._testTime) + key, data)
     # now try to read the data:
     self.assertEqual(t.read(str(self._testTime) + key), data)
     # commit the transaction and try to read the data with a new one:
     t.commit()
     t.close_connection()
     t = Transaction()
     self.assertEqual(t.read(str(self._testTime) + key), data)
     
     t.close_connection()
예제 #2
0
    def _writeSingleTest(self, key, data):
        t = Transaction()

        t.write(str(self._testTime) + key, data)
        # now try to read the data:
        self.assertEqual(t.read(str(self._testTime) + key), data)
        # commit the transaction and try to read the data with a new one:
        t.commit()
        t.close_connection()
        t = Transaction()
        self.assertEqual(t.read(str(self._testTime) + key), data)

        t.close_connection()
예제 #3
0
 def testWriteString(self):
     key = "_testWriteString1_"
     t = Transaction()
     
     for i in xrange(len(_TEST_DATA)):
         t.write(str(self._testTime) + key + str(i), _TEST_DATA[i])
     
     # now try to read the data:
     for i in xrange(len(_TEST_DATA)):
         actual = t.read(str(self._testTime) + key + str(i))
         self.assertEqual(actual, _TEST_DATA[i])
     
     # commit the transaction and try to read the data with a new one:
     t.commit()
     t.close_connection()
     t = Transaction()
     for i in xrange(len(_TEST_DATA)):
         actual = t.read(str(self._testTime) + key + str(i))
         self.assertEqual(actual, _TEST_DATA[i])
     
     t.close_connection()
예제 #4
0
    def testWriteString(self):
        key = "_testWriteString1_"
        t = Transaction()

        for i in xrange(len(_TEST_DATA)):
            t.write(str(self._testTime) + key + str(i), _TEST_DATA[i])

        # now try to read the data:
        for i in xrange(len(_TEST_DATA)):
            actual = t.read(str(self._testTime) + key + str(i))
            self.assertEqual(actual, _TEST_DATA[i])

        # commit the transaction and try to read the data with a new one:
        t.commit()
        t.close_connection()
        t = Transaction()
        for i in xrange(len(_TEST_DATA)):
            actual = t.read(str(self._testTime) + key + str(i))
            self.assertEqual(actual, _TEST_DATA[i])

        t.close_connection()
예제 #5
0
 def testCommit_Empty(self):
     t = Transaction()
     t.commit()
     t.close_connection()
예제 #6
0
 def testCommit_NotConnected(self):
     t = Transaction()
     t.close_connection()
     #self.assertRaises(scalaris.ConnectionError, t.commit)
     t.commit()
     t.close_connection()
예제 #7
0
 def testCommit_Empty(self):
     t = Transaction()
     t.commit()
     t.close_connection()
예제 #8
0
 def testCommit_NotConnected(self):
     t = Transaction()
     t.close_connection()
     #self.assertRaises(scalaris.ConnectionError, t.commit)
     t.commit()
     t.close_connection()