-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ConnectLife API test server (#8)
- Loading branch information
Showing
10 changed files
with
958 additions
and
732 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Development environment | ||
|
||
## Prerequisites: | ||
|
||
- [pyenv](https://github.com/pyenv/pyenv) | ||
|
||
## Install environment | ||
|
||
```bash | ||
pyenv install | ||
python -m venv venv | ||
source venv/bin/activate | ||
pip install . | ||
``` | ||
|
||
## Test server | ||
|
||
Test server that mocks the ConnectLife API. Runs on `http://localhost:8080`. | ||
|
||
The server reads all JSON files in the current directory, and serves them as appliances. Properties can be updated, | ||
but is not persisted. The only validation is that the `puid` and `property` exists, it assumes that all properties | ||
are writable and that any value is legal. | ||
|
||
```bash | ||
cd dumps | ||
python -m test_server | ||
``` | ||
|
||
To use the test server, provide the URL to the test server: | ||
```python | ||
from connectlife.api import ConnectLifeApi | ||
api = ConnectLifeApi(username="[email protected]", password="password", test_server="http://localhost:8080") | ||
``` |
This file contains 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
Oops, something went wrong.