Beispiel #1
0
 def setup_class(cls):
     unique_name = os.urandom(8).hex()
     cls.db_filename = DatabaseContext.shared_memory_uri(unique_name)
     cls.db_context = DatabaseContext(cls.db_filename)
     # We hold onto an open connection to ensure that the database persists for the
     # lifetime of the tests.
     cls.db = cls.db_context.acquire_connection()
     create_database(cls.db)
     update_database(cls.db)
     cls.store = wallet_database.WalletDataTable(cls.db_context)
Beispiel #2
0
 def get_db_context(self):
     return DatabaseContext(self.path)
Beispiel #3
0
def _db_context():
    wallet_path = os.path.join(tempfile.mkdtemp(), "wallet_create")
    assert not os.path.exists(wallet_path)
    migration.create_database_file(wallet_path)
    return DatabaseContext(wallet_path)