-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from rstcheck/create-ignore-dict-creator
add ignore dict constructor func
- Loading branch information
Showing
5 changed files
with
83 additions
and
39 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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"""Tests for ``types`` module.""" | ||
import re | ||
|
||
from rstcheck_core import types | ||
|
||
|
||
class TestIgnoreDictConstructor: | ||
"""Test ``construct_ignore_dict`` function.""" | ||
|
||
@staticmethod | ||
def test_no_args() -> None: | ||
"""Test construction of IgnoreDict with default values.""" | ||
result = types.construct_ignore_dict() | ||
|
||
assert result == types.IgnoreDict( | ||
messages=None, | ||
languages=[], | ||
directives=[], | ||
roles=[], | ||
substitutions=[], | ||
) | ||
|
||
@staticmethod | ||
def test_all_args() -> None: | ||
"""Test construction of IgnoreDict with set values.""" | ||
result = types.construct_ignore_dict( | ||
messages=re.compile("msg"), | ||
languages=["lang"], | ||
directives=["dir"], | ||
roles=["role"], | ||
substitutions=["sub"], | ||
) | ||
|
||
assert result == types.IgnoreDict( | ||
messages=re.compile("msg"), | ||
languages=["lang"], | ||
directives=["dir"], | ||
roles=["role"], | ||
substitutions=["sub"], | ||
) |