fix tests
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
81ccdc0fbb
commit
f5dfdfdca8
|
@ -39,7 +39,7 @@ def create_app():
|
|||
|
||||
app.config.from_file(os.path.join(os.getcwd(), "config.yaml"), yaml.safe_load)
|
||||
|
||||
from .micropub import micropub, auth_bp
|
||||
from .indieauth import micropub, auth_bp
|
||||
from .webmentions import webhook_bp
|
||||
|
||||
print(app.config)
|
||||
|
|
|
@ -27,7 +27,9 @@ def test_no_token_request(mocker):
|
|||
|
||||
rget = mocker.patch('microcosm.requests.get')
|
||||
|
||||
with microcosm.app.test_client() as c:
|
||||
app = microcosm.create_app()
|
||||
|
||||
with app.test_client() as c:
|
||||
response = c.get("/")
|
||||
assert response.status_code == 401
|
||||
assert response.json.get("error") == "unauthorized"
|
||||
|
@ -41,7 +43,9 @@ def test_invalid_token_request(mocker):
|
|||
|
||||
rget = mocker.patch('microcosm.requests.get', side_effect=expect_json_response({"me":"https://someothersite.com/"}))
|
||||
|
||||
with microcosm.app.test_client() as c:
|
||||
app = microcosm.create_app()
|
||||
|
||||
with app.test_client() as c:
|
||||
response = c.get("/", headers={'Authorization': 'Bearer SomeTestTokenValue'})
|
||||
assert response.status_code == 401
|
||||
assert response.json.get("error") == "insufficient_scope"
|
||||
|
|
Loading…
Reference in New Issue