-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f509c4
commit a906211
Showing
3 changed files
with
6 additions
and
33 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,24 +1,11 @@ | ||
from typing import Any | ||
|
||
import pytest | ||
|
||
from openfisca_core import entities | ||
|
||
from openfisca_core.entities.typing import Entity | ||
|
||
|
||
@pytest.fixture | ||
def entity() -> Any: | ||
"""An entity.""" | ||
|
||
return object() | ||
|
||
|
||
def test_init_when_doc_indented(entity: Entity) -> None: | ||
def test_init_when_doc_indented() -> None: | ||
"""De-indent the ``doc`` attribute if it is passed at initialisation.""" | ||
|
||
key = "\tkey" | ||
doc = "\tdoc" | ||
role = entities.Role({"key": key, "doc": doc}, entity) | ||
role = entities.Role({"key": key, "doc": doc}, object()) | ||
assert role.key == key | ||
assert role.doc == doc.lstrip() |