mirror of
https://github.com/ysoftdevs/Theatrical-Players-Refactoring-Kata.git
synced 2026-01-13 07:10:25 +01:00
26 lines
782 B
Python
26 lines
782 B
Python
import json
|
|
|
|
import pytest
|
|
from approvaltests import verify
|
|
from approvaltests.utils import get_adjacent_file
|
|
|
|
from statement import statement
|
|
|
|
|
|
def test_example_statement():
|
|
with open(get_adjacent_file("invoice.json")) as f:
|
|
invoice = json.loads(f.read())
|
|
with open(get_adjacent_file("plays.json")) as f:
|
|
plays = json.loads(f.read())
|
|
verify(statement(invoice, plays))
|
|
|
|
|
|
def test_statement_with_new_play_types():
|
|
with open(get_adjacent_file("invoice_new_plays.json")) as f:
|
|
invoice = json.loads(f.read())
|
|
with open(get_adjacent_file("new_plays.json")) as f:
|
|
plays = json.loads(f.read())
|
|
with pytest.raises(ValueError) as exception_info:
|
|
statement(invoice, plays)
|
|
assert "unknown type" in str(exception_info.value)
|