Schul-Cloud Content API
Project description
This repository contains
a server to test scrapers against
tests to test the server
Installation
Using pip, you can install all dependencies like this:
pip install schul_cloud_ressources_server_tests
When you are done, you can import the package.
import schul_cloud_ressources_server_tests
Usage
This section describes how to use the server and the tests.
Server
You can find the API definition. The server serves according to the API. It verifies the input and output for correctness.
To start the server, run
python3 -m schul_cloud_ressources_server_tests.app
The server should appear at http://localhost:8080/v1.
Tests
You always test against the running server. Tests may delete everyting you can reach. If you test the running server, make sure to authenticate in a way that does not destroy the data you want to keep.
pytest --pyargs schul_cloud_ressources_server_tests.test --url=http://localhost:8080/v1/
http://localhost:8080/v1/ is the default url.
Steps for Implementation
If you want to implement your server you can follow the TDD steps to implement one test after the other.
pytest --pyargs schul_cloud_ressources_server_tests.test -m step1
pytest --pyargs schul_cloud_ressources_server_tests.test -m step2
pytest --pyargs schul_cloud_ressources_server_tests.test -m step3
...
step1 runs the first test
step2 runs the first and the second test
step3 runs the first, second and third test
…
You can run a single test with
pytest --pyargs schul_cloud_ressources_server_tests.test -m step3only
TODO
generate a docker container for the server
generate a docker container for the tests
document how to embed the tests and the server in
a crawler
travis build script of arbitrary language
create example crawler with tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for schul_cloud_ressources_server_tests-1.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 736dfed40d3e5acc29bf5566c307631327e3091b9bb04d94a751731010cebf31 |
|
MD5 | 16d4850d0086ffe007784e22805a24b1 |
|
BLAKE2b-256 | f7e6af19844dce1106ecf9290ff48a7bcf5a1714bda6bb516b49242ae169ac9f |
Hashes for schul_cloud_ressources_server_tests-1.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d12b9268bc37ab863a92b7d3e6f8e846464595bc47471748570006573ce9c78 |
|
MD5 | 066afff7938c4b8267bd7966ed39d733 |
|
BLAKE2b-256 | 038aa9ac5b0c308666b78de62d5243399c1aff359fb4905bf18c22b3c6f1f59d |