| Conditions | 3 |
| Total Lines | 24 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | from kerapu.boom.attribuut.Attribuut import Attribuut |
||
| 6 | 1 | def maak_attribuut_groep_koppeling(attribute_groep_id: int, |
|
| 7 | attribuut: Attribuut, |
||
| 8 | attribuut_toets_wijze: int, |
||
| 9 | 1 | onder_toets_waarde: int, |
|
| 10 | boven_toets_waarde: int) -> AttribuutGroepKoppeling: |
||
| 11 | """ |
||
| 12 | Fabriek voor het maken van attribuutgroepkoppelingen. |
||
| 13 | |||
| 14 | :param int attribute_groep_id: Het ID van de koppeling. |
||
| 15 | :param Attribuut attribuut: Het attribuut van de koppeling. |
||
| 16 | :param int attribuut_toets_wijze: De attribuuttoetswijze. |
||
| 17 | :param int onder_toets_waarde: De ondergrens. |
||
| 18 | :param int boven_toets_waarde: De bovengrens. |
||
| 19 | |||
| 20 | :rtype: AttribuutGroepKoppeling |
||
| 21 | """ |
||
| 22 | if attribuut_toets_wijze == 1: |
||
| 23 | # Attribuuttoetswijze 1 wordt thans niet gebruikt in de grouper. |
||
| 24 | raise NotImplementedError("Attribuuttoetswijze %d is niet geïmplementeerd." % attribuut_toets_wijze) |
||
| 25 | 1 | ||
| 26 | if attribuut_toets_wijze == 2: |
||
| 27 | return AttribuutGroepKoppeling2(attribute_groep_id, attribuut, onder_toets_waarde, boven_toets_waarde) |
||
| 28 | |||
| 29 | 1 | raise RuntimeError("Onbekende attribuuttoetswijze %d." % attribuut_toets_wijze) |
|
| 30 | 1 | ||
| 32 |