Commit tests (untested)

This commit is contained in:
Christian Wolf 2023-09-13 15:23:18 +02:00
parent eafca2e9aa
commit 0d1310f287
2 changed files with 24 additions and 1 deletions

View File

@ -28,6 +28,29 @@ def test_pureClassParsing(fix_pureClass):
assert parser.isPureClass(className)
def test_classParsingWithPreview():
parser = solo_turnier.competition_class.CompetitionClassParser()
ret = parser.parseClass('Sichtung', True)
assert isinstance(ret, solo_turnier.competition_class.CompetitionClass)
assert str(ret) == 'Sichtung'
assert parser.isPureClass('Sichtung', True)
def test_classParsingInvalidPreview():
parser = solo_turnier.competition_class.CompetitionClassParser()
try:
parser.parseClass('Sichtung')
assert False
except:
assert True
try:
parser.isPureClass('Sichtung')
assert False
except:
assert True
@pytest.fixture(params=range(4))
def fix_combinedClass(request):
cases = (

View File

@ -4,7 +4,7 @@ import json
def test_import():
fileName = os.path.join(os.path.dirname(__file__), 'reader', 'test.csv')
reader = solo_turnier.reader.AllResultReader(fileName)
reader = solo_turnier.reader.CSVResultReader(fileName)
ret = reader.readFile()
with open(os.path.join(os.path.dirname(__file__), 'reader', 'expected.json')) as fp: