update tests

This commit is contained in:
hay-kot 2021-05-01 12:45:59 -08:00
commit aaa6bf84a7
2 changed files with 6 additions and 3 deletions

View file

@ -56,7 +56,9 @@ jobs:
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
run: poetry install
run: |
poetry install
poetry add "psycopg2-binary==2.8.6"
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
#----------------------------------------------
# run test suite
@ -72,5 +74,4 @@ jobs:
DB_ENGINE: postgres
POSTGRES_SERVER: localhost
run: |
poetry add "psycopg2-binary==2.8.6"
make test-all

View file

@ -49,13 +49,15 @@ def test_non_default_settings(monkeypatch):
assert app_settings.DOCS_URL is None
def test_default_connection_args():
def test_default_connection_args(monkeypatch):
monkeypatch.setenv("DB_ENGINE", "sqlite")
app_settings = AppSettings()
assert re.match(r"sqlite:////.*mealie/dev/data/mealie_v0.5.0.db", app_settings.DB_URL)
def test_pg_connection_args(monkeypatch):
monkeypatch.setenv("DB_ENGINE", "postgres")
monkeypatch.setenv("POSTGRES_SERVER", "mealie")
app_settings = AppSettings()
assert app_settings.DB_URL == "postgresql://mealie:mealie@postgres:5432/mealie"