# retoor <retoor@molodetz.nl>
|
|
|
|
import pytest
|
|
from pydantic import ValidationError
|
|
|
|
from devplacepy.models import GameLegacyForm
|
|
|
|
|
|
def test_game_legacy_form_accepts_valid_key():
|
|
assert GameLegacyForm(key="multiplier").key == "multiplier"
|
|
|
|
|
|
def test_game_legacy_form_rejects_empty_key():
|
|
with pytest.raises(ValidationError):
|
|
GameLegacyForm(key="")
|
|
|
|
|
|
def test_game_legacy_form_rejects_overlong_key():
|
|
with pytest.raises(ValidationError):
|
|
GameLegacyForm(key="x" * 41)
|