fixed tests not running
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
import db
|
||||
import pytest
|
||||
|
||||
from flask import current_app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
current_app.config['TESTING'] = True
|
||||
def client(mocker):
|
||||
mocker.patch("db.redis_client")
|
||||
db.redis_client.get.side_effect=lambda a: None
|
||||
|
||||
with current_app.test_client() as client:
|
||||
from app import app
|
||||
|
||||
app.config['TESTING'] = True
|
||||
|
||||
with app.test_client() as client:
|
||||
yield client
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ def test_log_code_get(client):
|
||||
|
||||
def test_log_code_post(client):
|
||||
data = {
|
||||
"uuid": os.environ["LOCAL_UUID"],
|
||||
"uuid": "asdasdasd",
|
||||
"message": "Hello There!"
|
||||
}
|
||||
r = client.post('/log', data = json.dumps(data))
|
||||
r = client.post('/log', json=data)
|
||||
|
||||
assert r.status_code == 204
|
||||
|
||||
Reference in New Issue
Block a user