✅ Added and updated tests
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import pytest
|
||||
from typing import Generator
|
||||
from fastapi.testclient import TestClient
|
||||
from classquiz import app
|
||||
|
||||
|
||||
class ValueStorage:
|
||||
quiz_id = None
|
||||
value2 = None
|
||||
|
||||
|
||||
example_quiz = {
|
||||
"public": False,
|
||||
"title": "Some test question",
|
||||
"description": "A description",
|
||||
"questions": [
|
||||
{
|
||||
"question": "Is ClassQuiz cool?",
|
||||
"time": 10,
|
||||
"answers": [{"right": True, "answer": "Yes"}, {"right": False, "answer": "No"}],
|
||||
},
|
||||
{
|
||||
"question": "Do you like open source?",
|
||||
"time": 5,
|
||||
"image": "https://i.imgur.com/sSNSy77.png",
|
||||
"answers": [
|
||||
{"right": True, "answer": "Yes"},
|
||||
{"right": False, "answer": "No"},
|
||||
{"right": False, "answer": "Maybe"},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
test_user_email = "sth@byom.de"
|
||||
test_user_password = "test"
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def test_client() -> Generator:
|
||||
with TestClient(app) as testclient:
|
||||
yield testclient
|
||||
|
||||
Reference in New Issue
Block a user