This commit is contained in:
		@@ -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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user