This repository has been archived on 2020-09-24. You can view files and clone it, but cannot push or open issues or pull requests.
consumer-api/consumer_api/tests/sync_view_test.py

30 lines
484 B
Python
Raw Normal View History

2020-05-08 21:25:18 +02:00
import json
import os
import pytest
from flask import current_app
@pytest.fixture
def client():
current_app.config['TESTING'] = True
with current_app.test_client() as client:
yield client
def test_log_code_get(client):
r = client.get('/sync')
assert r.status_code == 405
def test_log_code_post(client):
data = {
2020-05-13 14:22:48 +02:00
"uuid": os.environ["LOCAL_UUID"]
2020-05-08 21:25:18 +02:00
}
r = client.post('/sync', data = json.dumps(data))
assert r.status_code == 204