fixed tests not running
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
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
|
||||
|
||||
|
||||
def test_response_length(client):
|
||||
data = {
|
||||
"uuid": os.environ["LOCAL_UUID"],
|
||||
"message": "Hello There!"
|
||||
}
|
||||
r = client.get('/consumers', data = json.dumps(data))
|
||||
assert len(r) == 0
|
||||
r = client.get('/consumers')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user