Skip to content

Commit

Permalink
add pytest unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arbakker committed Aug 11, 2023
1 parent 07d1306 commit 5968569
Show file tree
Hide file tree
Showing 37 changed files with 524 additions and 401 deletions.
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ command_available() {
}
command_available "mypy"
print_message "pre-commit - running mypy static type checking" 1 "" true
if ! mypy coordinates_transformation_api;then
if ! mypy src;then
print_message "mypy static type check failed - commit aborted" 1 "ERROR" true
exit 1
fi
Expand Down
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"--reload",
"--port", "8000",
"coordinates_transformation_api.main:app",

],
"env": {
"LOG_LEVEL": "DEBUG",
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
"python.formatting.provider": "none",
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
7 changes: 6 additions & 1 deletion example/EXAMPLES.md → EXAMPLE_REQUESTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# EXAMPLES
# EXAMPLE REQUESTS

```sh
curl -X 'POST' 'http://localhost:8000/transform?source-crs=EPSG:28992&target-crs=EPSG:4326' -H 'Content-Type: application/json' -d @feature-geometry-collection.json
```


```sh
curl -X 'POST' 'http://localhost:8000/transform?source-crs=EPSG%3A28992&target-crs=EPSG%3A28992' \
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ Install enable precommit hook with:
git config --local core.hooksPath .githooks
```

To run debug session in VS Code install the package with `pip` with the `--editable` flag:

```sh
pip install --editable .
```

## Install

```bash
Expand Down
Loading

0 comments on commit 5968569

Please sign in to comment.