commit 5a8ac4b3cad1340b0ce01ac7432c3c59c2b4af80
parent b4702b9ab671217cd2d463b599dd562767a20ba1
Author: MS <ms@taler.net>
Date: Fri, 13 Nov 2020 18:50:10 +0100
Integration tests.
Provide method to empty all tables from sandbox and nexus.
Useful to provide a fresh testing environment without stop
services -> delete sqlite files -> start services again.
Diffstat:
1 file changed, 37 insertions(+), 0 deletions(-)
diff --git a/integration-tests/util.py b/integration-tests/util.py
@@ -46,6 +46,43 @@ def kill(name, s):
s.terminate()
s.wait()
+def flushTablesSandbox(dbName):
+ check_call(
+ ["sqlite3",
+ dbName,
+ "DELETE FROM BankAccountReports",
+ "DELETE FROM EbicsOrderSignatures",
+ "DELETE FROM BankAccountStatements",
+ "DELETE FROM EbicsSubscriberPublicKeys",
+ "DELETE FROM BankAccountTransactions",
+ "DELETE FROM EbicsSubscribers",
+ "DELETE FROM BankAccounts",
+ "DELETE FROM EbicsUploadTransactionChunks",
+ "DELETE FROM EbicsDownloadTransactions",
+ "DELETE FROM EbicsUploadTransactions",
+ "DELETE FROM EbicsHosts"
+ ]
+ )
+
+def flushTablesNexus(dbName):
+ check_call(
+ ["sqlite3",
+ dbName,
+ "DELETE FROM EbicsSubscribers",
+ "DELETE FROM NexusBankTransactions",
+ "DELETE FROM TalerFacadeState",
+ "DELETE FROM Facades",
+ "DELETE FROM NexusScheduledTasks",
+ "DELETE FROM TalerIncomingPayments",
+ "DELETE FROM NexusBankAccounts",
+ "DELETE FROM NexusUsers",
+ "DELETE FROM TalerRequestedPayments",
+ "DELETE FROM NexusBankConnections",
+ "DELETE FROM OfferedBankAccounts",
+ "DELETE FROM NexusBankMessages",
+ "DELETE FROM PaymentInitiations"
+ ]
+ )
def startSandbox(dbname="sandbox-test.sqlite3"):
db_full_path = str(Path.cwd() / dbname)