Compare commits

...

7 Commits

Author SHA1 Message Date
d96dfa8800 fix code style
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-21 21:22:39 +02:00
2f0dd2ab9f users/login: Provider user_id together with token
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-21 18:41:35 +02:00
ea7b6391c1 Merge pull request 'Add yapf to Pipenv environment' (#6) from add-yapf into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #6
2021-06-21 17:38:05 +02:00
cbf3002b93 Reformat source code
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-06-21 17:28:57 +02:00
59de00527d Ignore *.pyc-files for git
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-21 16:12:54 +02:00
6d4f933585 Add yapf to Pipfile 2021-06-21 16:09:37 +02:00
1390dfa8e6 Add usage of yapf to README 2021-06-21 16:09:26 +02:00
6 changed files with 19 additions and 9 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/.env
*.pyc

View File

@ -14,6 +14,7 @@ pyyaml = "~=5.4.1"
[dev-packages]
flake8 = "~=3.9.2"
yapf = "~=0.31.0"
[requires]
python_version = "3.8"

View File

@ -43,6 +43,13 @@ python -m unittest discover ki
flake8
```
### Formatierung
Um ein einheitliches Quellcode-Erlebnis zu haben, kann der Code mit yapf neu formatiert werden:
```
yapf -i --recursive ki/
```
### Testbenutzer

View File

@ -1 +1 @@
from ki import models, commands, routes # noqa
from ki import models, commands, routes # noqa

View File

@ -99,7 +99,7 @@ def login():
if token is None:
return make_response({}, 403)
return make_response({"token": token.token})
return make_response({"token": token.token, "user_id": token.user_id})
@app.route("/users/<user_id>/profile")

View File

@ -22,13 +22,14 @@ class TestSkillsEndpoint(unittest.TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(
{
"skills": [
{"id": 1, "name": "PHP"},
{"id": 3, "name": "Python"}
]
},
response.json
)
"skills": [{
"id": 1,
"name": "PHP"
}, {
"id": 3,
"name": "Python"
}]
}, response.json)
if __name__ == "main":