From 2c5444a24553664d33eeaed9b4692723915d2ede Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 8 May 2020 21:08:37 +0200 Subject: [PATCH] post --- consumer_api/tests/log_view_test.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/consumer_api/tests/log_view_test.py b/consumer_api/tests/log_view_test.py index 2b619b9..195be38 100644 --- a/consumer_api/tests/log_view_test.py +++ b/consumer_api/tests/log_view_test.py @@ -1,3 +1,6 @@ +import json +import os + import pytest from flask import current_app @@ -10,14 +13,18 @@ def client(): with current_app.test_client() as client: yield client + def test_log_code_get(client): r = client.get('/log') assert r.status_code == 405 + def test_log_code_post(client): - r = client.get('/log') + data = { + "uuid": os.environ["LOCAL_UUID"], + "message": "Hello There!" + } + r = client.post('/log', data = json.dumps(data)) assert r.status_code == 204 - -