Skip to content

Commit

Permalink
Changed FLASK_APP to wsgi:app
Browse files Browse the repository at this point in the history
  • Loading branch information
rofrano committed Feb 28, 2024
1 parent d940941 commit bb0d655
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- ..:/app
command: sleep infinity
environment:
FLASK_APP: service:app
FLASK_APP: wsgi:app
FLASK_DEBUG: "True"
GUNICORN_BIND: "0.0.0.0:8000"
DATABASE_URI: postgresql+psycopg://postgres:pgs3cr3t@postgres:5432/postgres
Expand Down
6 changes: 4 additions & 2 deletions tests/test_cli_commands.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"""
CLI Command Extensions for Flask
"""

import os
from unittest import TestCase
from unittest.mock import patch, MagicMock
from click.testing import CliRunner

# pylint: disable=unused-import
from wsgi import app # noqa: F401
from service.common.cli_commands import db_create # noqa: E402
Expand All @@ -16,10 +18,10 @@ class TestFlaskCLI(TestCase):
def setUp(self):
self.runner = CliRunner()

@patch('service.common.cli_commands.db')
@patch("service.common.cli_commands.db")
def test_db_create(self, db_mock):
"""It should call the db-create command"""
db_mock.return_value = MagicMock()
with patch.dict(os.environ, {"FLASK_APP": "service:app"}, clear=True):
with patch.dict(os.environ, {"FLASK_APP": "wsgi:app"}, clear=True):
result = self.runner.invoke(db_create)
self.assertEqual(result.exit_code, 0)

0 comments on commit bb0d655

Please sign in to comment.