using in-memory db

This commit is contained in:
ari committed 2022-08-31 15:44:52 -04:00
1 parent 00c234541d
commit 499752e02f
6 files changed
+51 -115

No files matched your search

+1 -12
View File
@@ -1,19 +1,8 @@
from pathlib import Path
from tempfile import mktemp
from unittest import TestCase
from src.automations.db import AutomationDBConnection
def make_temp_db():
return AutomationDBConnection(Path(mktemp() + ".db"))
class TestWithDB(TestCase):
def setUp(self) -> None:
self.db = make_temp_db()
self.db.create_db()
self.db_file = self.db.db_file
def tearDown(self) -> None:
self.db_file.unlink()
self.db = AutomationDBConnection()