-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Factor out assert_message_model_error
- Loading branch information
Alexander Senier
committed
Jul 13, 2020
1 parent
49218ed
commit 01fc085
Showing
3 changed files
with
32 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
from typing import Any | ||
from typing import Any, Mapping, Sequence | ||
|
||
import pytest | ||
|
||
from rflx.error import Location, RecordFluxError | ||
from rflx.model import Field, Link, Message, Type | ||
|
||
|
||
def assert_equal(left: Any, right: Any) -> None: | ||
assert left == right | ||
|
||
|
||
def assert_message_model_error( | ||
structure: Sequence[Link], types: Mapping[Field, Type], regex: str, location: Location = None | ||
) -> None: | ||
with pytest.raises(RecordFluxError, match=regex): | ||
Message("P.M", structure, types, location) |