Testing — Aquilia Documentation
Comprehensive guide and documentation for Testing in the Aquilia framework. View API reference, examples, and implementation patterns.
Tooling / Testing Testing Framework Aquilia provides a batteries-included testing framework designed to test async controllers, background jobs, DB integrations, and WebSocket endpoints. It features automated server lifecycle hooks, DI mocking containers, mock storage, and custom assertions. Testing Architecture Testing in Aquilia avoids slow network calls and side effects by leveraging in-process ASGI loops. It connects your tests directly to the dependency container, permitting run-time provider swapping: , , ].map((item, i) => ( ))} Native Wheel Verification Release-wheel tests must prove that the installed wheel loads all three native modules. Run the check outside the repository checkout; otherwise the source tree can shadow the installed package and create a false result. python tools/check_installed_native.py # Equivalent assertions for an installed release wheel: python -c "from aquilia._core_loader import NATIVE; from aquilia._dataengine_loader import DATAENGINE_NATIVE; from aquilia.json import native as JSON_NATIVE; assert NATIVE and DATAENGINE_NATIVE and JSON_NATIVE" v1.4.0b5 CI also tests the opposite contract on Windows 3.14: an sdist installed with invalid compiler paths must succeed and report all three fallbacks. Keep strict wheel tests and compiler-free source-install tests separate; they validate intentionally different outcomes. Writing Your First Test Subclass AquiliaTestCase to write an integration test. The server automatically starts up before the test runs and self-terminates on completion: from aquilia.testing import AquiliaTestCase from myapp.manifests import users_manifest class TestUserAPI(AquiliaTestCase): # Specify the manifests to load into the test server manifests = [users_manifest] # Overwrite configuration fields settings = } async def test_create_user(self): # Trigger an HTTP post response = await self.client.post("/api/users", json= ) # Use built-in assertions self.assert_status(response, 201) self.assert_json_path(response, "username", "testguy") Framework Reference , , , ].map((sec, i) => ( → ))} CLI OpenAPI )
Go to Homepage