Harden parsing, fix bugs, and add offline + authenticated tests - #4
Open
dmoraine wants to merge 1 commit into
Open
Harden parsing, fix bugs, and add offline + authenticated tests#4dmoraine wants to merge 1 commit into
dmoraine wants to merge 1 commit into
Conversation
Bug fixes: - Rename duplicate test method names that silently shadowed each other, so the intended assertions actually run. - utils.nowtimestamp_millis: return an int of epoch seconds and drop the deprecated datetime.utcnow() in favour of a timezone-aware now. - Remove the unused "requests" dependency (code uses curl_cffi only). - Drop dead Python 2 code paths (unicode / sys.version_info). Hardening: - process_raw_airline_fleet_data: guard cell indexing and skip malformed rows instead of raising when flightradar24 tweaks its HTML. - login: wrap the request and token extraction, and return a bool. Tests: - New offline unit suite (test_unit.py) with no network access, covering fltr, timestamp helpers, byteify/encode, FR24 state and fleet parsing, get_flight_for_date filtering, weather km conversion, login paths, and the credential loader. Runs as a real CI gate. - New authenticated online suite (test_online_auth.py) that logs in with credentials from FR24_EMAIL/FR24_PASSWORD or a local .env, and asserts a logged-in client sees at least as much history as an anonymous one. Skips cleanly when no credentials are configured. - conftest.py credential loader/fixture. - pytest.ini: narrow python_files to test_*.py and register markers. - CI: split offline unit tests (hard gate) from informational network tests, and pass FR24 secrets through when present. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Résumé
Passe de maintenance sur le fork : correction de bugs, durcissement du parsing fragile, et surtout une vraie couverture de tests (offline + authentifiée en ligne).
Corrections de bugs
utils.nowtimestamp_millis: renvoie désormais unintde secondes epoch et remplacedatetime.utcnow()(déprécié en 3.12) par unnowtimezone-aware.requestsinutile retirée (le code n'utilise quecurl_cffi).unicode/sys.version_info).Durcissement
process_raw_airline_fleet_data: gardes sur l'indexation des cellules, les lignes malformées sont ignorées au lieu de leverIndexError/AttributeErrorquand flightradar24 modifie son HTML.login: requête et extraction du token encapsulées, retourne unbool.Tests
test_unit.py, 44 tests, sans réseau) :fltr, helpers de timestamp, byteify/encode, état et parsing de flotteFR24, filtrage deget_flight_for_date, conversion mi→km météo, tous les chemins delogin, et le loader de credentials. Devient un vrai gate CI.test_online_auth.py) : login viaFR24_EMAIL/FR24_PASSWORDou un.envlocal, et assertion clé — un client connecté voit au moins autant d'historique qu'un anonyme, à budget de pages égal (le seul différenciateur des plans payants). Se skippe proprement sans credentials. Validée en conditions réelles (4 passed).conftest.py: loader/fixture de credentials.pytest.ini:python_filesrestreint àtest_*.pyet markersonline/authenregistrés.FR24_*s'ils existent.🤖 Generated with Claude Code