file name updated
authorSam Mirazi <sasan345@gmail.com>
Sat, 31 May 2025 05:26:45 +0000 (22:26 -0700)
committerSam Mirazi <sasan345@gmail.com>
Sat, 31 May 2025 05:26:45 +0000 (22:26 -0700)
app_flask/__pycache__/flask_application.cpython-312.pyc [new file with mode: 0644]
app_flask/app.py [deleted file]
app_flask/flask_application.py [new file with mode: 0644]
tests/__pycache__/test_flask_route.cpython-312-pytest-8.3.5.pyc
tests/test_flask_route.py

diff --git a/app_flask/__pycache__/flask_application.cpython-312.pyc b/app_flask/__pycache__/flask_application.cpython-312.pyc
new file mode 100644 (file)
index 0000000..613afc6
Binary files /dev/null and b/app_flask/__pycache__/flask_application.cpython-312.pyc differ
diff --git a/app_flask/app.py b/app_flask/app.py
deleted file mode 100644 (file)
index bd4f688..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-from flask import Flask, Response
-import time
-import webbrowser
-
-app = Flask(__name__)
-
-@app.route("/")
-def home():
-    time.sleep(3)                # simulate slow work
-    html = "Hello from Flask :)"
-    return Response(html, mimetype="text/html")
-
-if __name__ == "__main__":
-    host = "127.0.0.1"
-    port = 3000
-    url = f"http://{host}:{port}/"
-    
-    # Open the URL in a new browser tab
-    webbrowser.open_new_tab(url)
-    
-    app.run(host=host, port=port) 
\ No newline at end of file
diff --git a/app_flask/flask_application.py b/app_flask/flask_application.py
new file mode 100644 (file)
index 0000000..bd4f688
--- /dev/null
@@ -0,0 +1,21 @@
+from flask import Flask, Response
+import time
+import webbrowser
+
+app = Flask(__name__)
+
+@app.route("/")
+def home():
+    time.sleep(3)                # simulate slow work
+    html = "Hello from Flask :)"
+    return Response(html, mimetype="text/html")
+
+if __name__ == "__main__":
+    host = "127.0.0.1"
+    port = 3000
+    url = f"http://{host}:{port}/"
+    
+    # Open the URL in a new browser tab
+    webbrowser.open_new_tab(url)
+    
+    app.run(host=host, port=port) 
\ No newline at end of file
index bab6036ddc123f863769bcf4cd2107a9ef8ffcde..c1722ee5ccde3ef84ffba700013ff44010e3b294 100644 (file)
Binary files a/tests/__pycache__/test_flask_route.cpython-312-pytest-8.3.5.pyc and b/tests/__pycache__/test_flask_route.cpython-312-pytest-8.3.5.pyc differ
index 0fc0aafa817571ae713a1c78c5c99cdc775cd3d4..0ab89a3f5444c408fc0bdcfc1d91e5408afe36bf 100644 (file)
@@ -4,14 +4,14 @@ import subprocess, time, os, signal
 def start_server():
     # Ensure the Python interpreter can find the app_flask module.
     # This might require adjusting PYTHONPATH or running pytest from the project root.
-    proc = subprocess.Popen(["python", "-m", "app_flask.app"]) # Removed cwd=".."
+    proc = subprocess.Popen(["python", "-m", "app_flask.flask_application"]) # Updated module name
     time.sleep(1)  # Increased sleep to allow server startup, especially on slower systems
     return proc
 
 def test_home_returns_html():
     proc = start_server()
     try:
-        r = httpx.get("http://127.0.0.1:5000/", timeout=10)
+        r = httpx.get("http://127.0.0.1:3000/", timeout=10)
         assert r.status_code == 200
         assert "Hello from Flask :)" in r.text  # Corrected assertion
     finally: