Anachronos
A testing framework for testing frameworks.
Anachronos is an end-to-end testing framework usable with a wide variety of applications.
To get started, define an ApplicationRunner which can be used to start your application.
Then, write your test classes by inheriting from anachronos.TestCase.
How it works
The framework provides access to a special Anachronos object which is accessible both from the tested application, and from the testing suite.
This object effectively acts as a logger on which assertions can be run afterwards. Anachronos assertions are accessible by using the self.assertThat method from within a TestCase.
Below is a simple TestCase example taken from the Jivago framework.
import anachronos
from e2e_test.runner import http
from e2e_test.testing_messages import SIMPLE_GET
class SimpleResourceTest(anachronos.TestCase):
def test_simple_get(self):
http.get("/")
self.assertThat(SIMPLE_GET).is_stored()
def test_post_dto(self):
response = http.post("/", json={'name': 'Paul Atreides', 'age': 17}).json()
self.assertEqual('Paul Atreides', response['name'])
if __name__ == '__main__':
anachronos.run_tests()
With the matching application logic :
import anachronos
from e2e_test.app.components.dtos.request_dto import RequestDto
from e2e_test.app.components.dtos.response_dto import ResponseDto
from e2e_test.testing_messages import SIMPLE_GET
from jivago.lang.annotations import Inject
from jivago.wsgi.annotations import Resource
from jivago.wsgi.methods import GET, POST
@Resource("/")
class SimpleResource(object):
def __init__(self):
self.anachronos = anachronos.get_instance()
@GET
def simple_get(self) -> str:
self.anachronos.store(SIMPLE_GET)
return "OK"
@POST
def post_body(self, request: RequestDto) -> ResponseDto:
return ResponseDto(request.name, True)
Metadata
Release files for anachronos 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| anachronos-0.0.7.tar.gz | 22.9 kB | Without provenance | Details |
Release files / anachronos-0.0.7.tar.gz
| Download URL | anachronos-0.0.7.tar.gz |
|---|---|
| Size | 22.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2e3b406b00a0ade92f43dec828e43bfb49c951ac1eef029ac0485eff099caf2
|
|
BLAKE2b-256 checksum How to use checksums |
919dfb20223bacb8140237292ab45570d921224d7bede9b4b508d30f0364c043
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.1
|
Security for anachronos 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.