Esempio n. 1
0
 def test_destroy(self):
     self.assertFalse(hstore.exists(connection_uri, 'test'))
     c = self.open_connection(connection_uri)
     d = hstore.open(c, 'test')
     self.assertTrue(hstore.exists(connection_uri, 'test'))
     d.destroy()
     self.assertFalse(hstore.exists(connection_uri, 'test'))
Esempio n. 2
0
 def test_destroy_after_close(self):
     self.assertFalse(hstore.exists(connection_uri, 'test'))
     c = self.open_connection(connection_uri)
     d = hstore.open(c, 'test')
     self.assertTrue(hstore.exists(connection_uri, 'test'))
     d.close()
     with self.assertRaises(ValueError):
         d.destroy() # must be open to destroy
Esempio n. 3
0
 def test_exists(self):
     self.assertFalse(
         hstore.exists(connection_uri, 'test'))
     self.assertFalse(
         hstore.exists(self.open_connection(connection_uri), 'test'))
     d = self.open_hstore(connection_uri, 'test')
     self.assertTrue(
         hstore.exists(connection_uri, 'test'))
     self.assertTrue(
         hstore.exists(self.open_connection(connection_uri), 'test'))
Esempio n. 4
0
 def dbopen(name):
     if create:
         return hstore.open(self.__connection, name)
     if hstore.exists(self.__connection, name):
         return hstore.open(self.__connection, name)
     raise ValueError('hstore {} does not exist'.format(name))
Esempio n. 5
0
 def dbopen(name):
     if create:
         return hstore.open(self.__connection, name)
     if hstore.exists(self.__connection, name):
         return hstore.open(self.__connection, name)
     raise ValueError('hstore {} does not exist'.format(name))