-
Notifications
You must be signed in to change notification settings - Fork 5
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
009fc0e
commit 39c87b3
Showing
3 changed files
with
70 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
""" | ||
Contains Bankverbindung class and corresponding marshmallow schema for de-/serialization | ||
""" | ||
|
||
# pylint: disable=too-few-public-methods, too-many-instance-attributes | ||
# pylint: disable=no-name-in-module | ||
from typing import TYPE_CHECKING, Optional | ||
|
||
from ..utils import postprocess_docstring | ||
from .com import COM | ||
|
||
if TYPE_CHECKING: | ||
from ..enum.preismodell import Preismodell | ||
from ..enum.rechnungslegung import Rechnungslegung | ||
from ..enum.sparte import Sparte | ||
from ..enum.vertragsform import Vertragsform | ||
from .ausschreibungsdetail import Ausschreibungsdetail | ||
from .menge import Menge | ||
from .zeitraum import Zeitraum | ||
|
||
|
||
@postprocess_docstring | ||
class Bankverbindung(COM): | ||
""" | ||
Eine Komponente zur Abbildung einer einzelner Bankverbindung | ||
.. raw:: html | ||
<object data="../_static/images/bo4e/com/Bankverbindung.svg" type="image/svg+xml"></object> | ||
.. HINT:: | ||
`Bankverbindung JSON Schema <https://json-schema.app/view/%23?url=https://raw.githubusercontent.com/BO4E/BO4E-Schemas/{__gh_version__}/src/bo4e_schemas/com/Bankverbindung.json>`_ | ||
""" | ||
|
||
iban: Optional[str] = None | ||
|
||
kontoinhaber: Optional[str] = None | ||
|
||
bankkennung: Optional[str] = None | ||
|
||
bankname: Optional[str] = None |
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,26 @@ | ||
import pytest | ||
|
||
from bo4e import Bankverbindung | ||
from tests.serialization_helper import assert_serialization_roundtrip | ||
|
||
|
||
class TestBankverbindung: | ||
@pytest.mark.parametrize( | ||
"bankverbindung", | ||
[ | ||
pytest.param( | ||
Bankverbindung( | ||
iban="foo-ban", | ||
kontoinhaber="Jürgen W.", | ||
bankkennung="1234Geiz5678", | ||
bankname="Geiz&Geiziger", | ||
), | ||
id="maximal attributes", | ||
), | ||
], | ||
) | ||
def test_serialization_roundtrip(self, bankverbindung: Bankverbindung) -> None: | ||
""" | ||
Test de-/serialisation of Ausschreibungslos | ||
""" | ||
assert_serialization_roundtrip(bankverbindung) |