From e47c11e10b8bee7d6b46471344524a6bb70d413d Mon Sep 17 00:00:00 2001 From: Sergey Popinevskiy Date: Tue, 3 Jul 2018 00:18:48 +0300 Subject: [PATCH] Supported relative location of db store (#6) --- conf.sample.py | 7 ++++++- tests/test_db.py | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/conf.sample.py b/conf.sample.py index 6b30ba6..01a2503 100644 --- a/conf.sample.py +++ b/conf.sample.py @@ -1,4 +1,9 @@ # -*- coding: utf-8 -*- +import os + +here = os.path.dirname(os.path.abspath(__file__)) + + accounts = { 'OTA.TCH': { 'user': 'ota_grs101', @@ -12,7 +17,7 @@ sender = ('Anton Yakovlev', 'anton.yakovlev@a.gentlemantravel.club') recipient_info = 'airquota@ota.ru' recipient_alert = 'airquota.alert@ota.ru' -db_name = 'db/quota.db' +db_name = os.path.join(here, 'db/quota.db') smtp_gateway= 'email-smtp.eu-west-1.amazonaws.com' smtp_port = 587 smtp_user = 'aws_ses_user' diff --git a/tests/test_db.py b/tests/test_db.py index 2e6ae9c..16f722f 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -4,9 +4,11 @@ import pytest from manage import setup_store +here = os.path.dirname(os.path.abspath(__file__)) + class TestDB(): - db_name = 'db/test.db' + db_name = os.path.join(here, '../db/test.db') def test_init_db(self): try: