MIL-002: backend basics and Hello Flask #33

Merged
Tirsvad merged 5 commits from mil-002-hello-flask into main 2026-11-06 05:36:43 +01:00
2 changed files with 31 additions and 0 deletions
Showing only changes of commit 893fa59263 - Show all commits

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
import pytest
flask = pytest.importorskip("flask")
def _client() -> "flask.testing.FlaskClient":
from flask_day_54.presentation.hello import app
return app.test_client()
def test_root_returns_greeting_when_get() -> None:
response = _client().get("/")
assert response.status_code == 200
assert response.get_data(as_text=True) == "Hello, World!"
def test_unknown_path_returns_404() -> None:
assert _client().get("/missing").status_code == 404
def test_root_content_type_is_html() -> None:
response = _client().get("/")
assert response.content_type.startswith("text/html")
+5
View File
@@ -0,0 +1,5 @@
from flask_day_54.application.get_greeting import get_greeting
def test_get_greeting_returns_hello_world() -> None:
assert get_greeting() == "Hello, World!"