Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
ADD: Test
Browse files Browse the repository at this point in the history
  • Loading branch information
claussmann committed Jan 26, 2024
1 parent 0ac8a67 commit 19ab05f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyteamquiz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
if filename.endswith(".txt")
}
else:
catalogues = set()
catalogues = dict()
23 changes: 22 additions & 1 deletion pyteamquiz/test/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,26 @@
from pyteamquiz.question import *
from pyteamquiz.errors import *
from pyteamquiz.game import *
from pyteamquiz.service import *
from pyteamquiz import service
from pyteamquiz import catalogues
import os


def get_catalogue_1():
content = """
What is correct?;;A;;B;;C;;D
What is correct?;;A;;B;;C;;D;;E
What is correct?;;A;;B;;C;;D;;E
"""
filename = "testfile-aesfhdshdfs2132312.txt"
f = open(filename, "w")
f.write(content)
f.close()
catalogue = QuestionCatalogueFile(filename)
os.remove(filename)
return catalogue

def test_game_creation():
catalogues["Example.txt"] = get_catalogue_1()
token = service.new_game({"Example.txt"}, {"Team A", "Team B"})
assert service.get_current_question_text(token) == "What is correct?"

0 comments on commit 19ab05f

Please sign in to comment.