about summary refs log tree commit diff
path: root/test/python/test_hello_world.py
AgeCommit message (Collapse)Author
2026-10-01Add /version endpoint, extract shared python test helper.Pjotr Prins
* .gitignore: Add __pycache__. * src/lib.rs (app): Add /version route. (VersionInfo, version): New struct and handler, returning name, short_name, version, release, date, and git as a JSON record. * build.rs: New file. Embeds GN4_GIT_HASH and GN4_COMMIT_DATE via cargo:rustc-env, read from git rev-parse and git show of HEAD. * Cargo.toml (dependencies): Add serde with derive feature. [dev-dependencies]: Add serde_json. * tests/version.rs: New file. * test/python/server_test_case.py: New file. ServerTestCase, wait_for_port, BINARY, HOST, PORT moved here from test/python/test_hello_world.py. * test/python/test_hello_world.py: Use server_test_case.ServerTestCase instead of duplicating setUpClass and tearDownClass. * test/python/test_version.py: New file. * guix.scm: Add (gnu packages version-control) to use-modules. (genenetwork4-git)[native-inputs]: Add git-minimal. (genenetwork4-git)[arguments]<#:phases>[python-rest-test]: Run test/python with python3 -m unittest discover instead of invoking test_hello_world.py directly, so test_version.py also runs.
2026-10-01Add Python REST API test, run it from guix.scm.Pjotr Prins
* src/main.rs (main): Read GENENETWORK4_PORT environment variable for the listen port, default to 3000. * test/python/test_hello_world.py: New file. * guix.scm: Add (gnu packages python) to use-modules. (genenetwork4-git)[native-inputs]: Add python. (genenetwork4-git)[arguments]<#:phases>: Add 'python-rest-test phase after 'install, running test/python/test_hello_world.py against the installed binary on port 3737.