Пример #1
0
 def setUp(self):
     gludb.config.default_database(None)  # no default database
     gludb.config.class_database(
         SimpleStorage,
         gludb.config.Database('postgresql', conn_string=PG_CONN_STR))
     delete_test_tables()
     SimpleStorage.ensure_table()
 def setUp(self):
     gludb.config.default_database(None)  # no default database
     gludb.config.class_database(SimpleStorage, gludb.config.Database(
         'mongodb',
         mongo_url='mongodb://localhost:27017/gludb_testing'
     ))
     delete_test_colls()
     SimpleStorage.ensure_table()
Пример #3
0
 def setUp(self):
     gludb.config.default_database(None)  # no default database
     gludb.config.class_database(SimpleStorage, gludb.config.Database(
         'postgresql',
         conn_string=PG_CONN_STR
     ))
     delete_test_tables()
     SimpleStorage.ensure_table()
Пример #4
0
 def setUp(self):
     gludb.config.default_database(None)  # no default database
     gludb.config.class_database(
         SimpleStorage,
         gludb.config.Database(
             'mongodb',
             mongo_url='mongodb://localhost:27017/gludb_testing'))
     delete_test_colls()
     SimpleStorage.ensure_table()
Пример #5
0
def delete_test_tables():
    import psycopg2
    with psycopg2.connect(PG_CONN_STR) as conn:
        with conn.cursor() as cur:
            cur.execute("drop table if exists " +
                        SimpleStorage.get_table_name())
            cur.execute("drop table if exists " + IndexedData.get_table_name())
def delete_test_colls():
    gludb.backends.mongodb.delete_collection(
        'gludb_testing',
        SimpleStorage.get_table_name()
    )
    gludb.backends.mongodb.delete_collection(
        'gludb_testing',
        IndexedData.get_table_name()
    )
    def test_repeated_creates(self):
        SimpleStorage.ensure_table()
        SimpleStorage.ensure_table()
        SimpleStorage.ensure_table()

        IndexedData.ensure_table()
        IndexedData.ensure_table()
        IndexedData.ensure_table()
Пример #8
0
    def test_repeated_creates(self):
        SimpleStorage.ensure_table()
        SimpleStorage.ensure_table()
        SimpleStorage.ensure_table()

        IndexedData.ensure_table()
        IndexedData.ensure_table()
        IndexedData.ensure_table()
Пример #9
0
 def test_delete(self):
     s = SimpleStorage()
     self.assertRaises(DeleteNotSupported, s.delete)
Пример #10
0
 def tearDown(self):
     # Undo any database setup
     gludb.backends.dynamodb.delete_table(
         SimpleStorage.get_table_name()
     )
     gludb.config.clear_database_config()
Пример #11
0
 def setUp(self):
     gludb.config.default_database(None)  # no default database
     gludb.config.class_database(SimpleStorage, gludb.config.Database(
         'dynamodb'
     ))
     SimpleStorage.ensure_table()
Пример #12
0
def delete_test_colls():
    gludb.backends.mongodb.delete_collection('gludb_testing',
                                             SimpleStorage.get_table_name())
    gludb.backends.mongodb.delete_collection('gludb_testing',
                                             IndexedData.get_table_name())
Пример #13
0
def delete_test_tables():
    import psycopg2
    with psycopg2.connect(PG_CONN_STR) as conn:
        with conn.cursor() as cur:
            cur.execute("drop table if exists " + SimpleStorage.get_table_name())
            cur.execute("drop table if exists " + IndexedData.get_table_name())