Skip to content

Commit

Permalink
Test: test d'Hondt negativo; EGCETSII#27
Browse files Browse the repository at this point in the history
  • Loading branch information
isamunval committed Jan 6, 2022
1 parent 38c43bd commit f37a65c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions decide/postproc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,4 +326,27 @@ def test_dhondt(self):

values = response.json()
self.assertEqual(values, expected_result)

def test_dhondt_error(self):
"""
* Definicion: Test negativo que no recibe escaños
* Entrada: Votacion
- Number: id del partido
- Option: nombre de la opcion
- Votes: Numero de votos que recibe en la votación
* Salida: Codigo 200 con mensaje de que no hay escaños suficientes para repartir
"""

data = {
"type": "DHONDT",
"seats": 0,
"options": [
{ "option": "Option 1", "number": 1, "votes": 10 },
{ "option": "Option 2", "number": 2, "votes": 0 },
{ "option": "Option 3", "number": 3, "votes": 0 },
{ "option": "Option 4", "number": 4, "votes": 1 },
{ "option": "Option 5", "number": 5, "votes": 4 },
{ "option": "Option 6", "number": 6, "votes": 2 },
]
}

0 comments on commit f37a65c

Please sign in to comment.