Skip to content

Commit

Permalink
Fix cache database for PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed Feb 7, 2024
1 parent 52e64fb commit 429e2df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Binary file modified tests/bitcoinlib_cache_unittest1
Binary file not shown.
Binary file modified tests/bitcoinlib_cache_unittest2
Binary file not shown.
10 changes: 7 additions & 3 deletions tests/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,9 +820,13 @@ def setUpClass(cls):
try:
con = psycopg.connect(user='postgres', host='localhost', password='postgres', autocommit=True)
cur = con.cursor()
cur.execute(sql.SQL("CREATE DATABASE {}").format(
sql.Identifier('bitcoinlibcache.unittest'))
)
try:
cur.execute(sql.SQL("DROP DATABASE IF EXISTS {}").format(sql.Identifier(CACHE_DBNAME1)))
cur.execute(sql.SQL("DROP DATABASE IF EXISTS {}").format(sql.Identifier(CACHE_DBNAME2)))
cur.execute(sql.SQL("CREATE DATABASE {}").format(sql.Identifier(CACHE_DBNAME1)))
cur.execute(sql.SQL("CREATE DATABASE {}").format(sql.Identifier(CACHE_DBNAME2)))
except:
pass
cur.close()
con.close()
except Exception:
Expand Down

0 comments on commit 429e2df

Please sign in to comment.