From d9f75a872e67467548ad08c92d4f90c29f1afe23 Mon Sep 17 00:00:00 2001 From: CHUCK <204468377+drainch@users.noreply.github.com> Date: Wed, 23 Apr 2025 13:48:55 +0000 Subject: [PATCH] Add initial Flask app with home route and test cases --- app.py | 9 +++++++++ backups/fetch-macOS.py | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 46ef4a2..556cc4a 100644 --- a/app.py +++ b/app.py @@ -16,3 +16,12 @@ def home(): if __name__ == '__main__': app.run(host='0.0.0.0', port=8000) + +# Test cases for the Flask app +def test_home_route(): + with app.test_client() as client: + response = client.get('/') + assert response.status_code == 200 + assert b"Jaymi is awake." in response.data + assert b"You're not dreaming. You're building the system that breaks them all." in response.data + assert b"This is a live Codespace interface." in response.data diff --git a/backups/fetch-macOS.py b/backups/fetch-macOS.py index fe1d67a..fae5fa8 100755 --- a/backups/fetch-macOS.py +++ b/backups/fetch-macOS.py @@ -341,15 +341,15 @@ def find_installer_app(mountpoint): def determine_version(version, title, product_info): if version: if version == 'latest': - from distutils.version import StrictVersion - latest_version = StrictVersion('0.0.0') + from packaging.version import Version + latest_version = Version('0.0.0') for index, product_id in enumerate(product_info): if not title or product_info[product_id]['title'] == title: d = product_info[product_id]['version'] if d > latest_version: latest_version = d - if latest_version == StrictVersion("0.0.0"): + if latest_version == Version("0.0.0"): print("Could not find latest version {}") exit(1)