summaryrefslogtreecommitdiff
path: root/Biz/PodcastItLater/Worker.py
diff options
context:
space:
mode:
Diffstat (limited to 'Biz/PodcastItLater/Worker.py')
-rw-r--r--Biz/PodcastItLater/Worker.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/Biz/PodcastItLater/Worker.py b/Biz/PodcastItLater/Worker.py
index 834d44b..ce3d432 100644
--- a/Biz/PodcastItLater/Worker.py
+++ b/Biz/PodcastItLater/Worker.py
@@ -41,7 +41,14 @@ S3_ENDPOINT = os.getenv("S3_ENDPOINT")
S3_BUCKET = os.getenv("S3_BUCKET")
S3_ACCESS_KEY = os.getenv("S3_ACCESS_KEY")
S3_SECRET_KEY = os.getenv("S3_SECRET_KEY")
-DATABASE_PATH = os.getenv("DATABASE_PATH", "podcast.db")
+area = App.from_env()
+if area == App.Area.Test:
+ DATABASE_PATH = os.getenv(
+ "DATABASE_PATH",
+ "_/var/podcastitlater/podcast.db",
+ )
+else:
+ DATABASE_PATH = os.getenv("DATABASE_PATH", "/var/podcastitlater/podcast.db")
# Worker configuration
MAX_CONTENT_LENGTH = 5000 # characters for TTS
@@ -943,7 +950,12 @@ class TestJobProcessing(Test.TestCase):
def setUp(self) -> None:
"""Set up test environment."""
- self.test_db = "test_podcast_worker.db"
+ self.test_db = "_/var/podcastitlater/test_podcast_worker.db"
+
+ # Ensure test directory exists
+ test_db_dir = pathlib.Path(self.test_db).parent
+ test_db_dir.mkdir(parents=True, exist_ok=True)
+
# Clean up any existing test database
test_db_path = pathlib.Path(self.test_db)
if test_db_path.exists():