forked from JJ/tests-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHitosIV_test.py
More file actions
26 lines (19 loc) · 752 Bytes
/
HitosIV_test.py
File metadata and controls
26 lines (19 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from HitosIV import HitosIV
def test_should_initialize_object_OK():
hitos = HitosIV()
assert type(hitos) is HitosIV, "No se han podido inicializar los hitos"
def test_should_have_hitos_stored_correctly():
hitos = HitosIV()
assert type(hitos.todos_hitos()) is dict, "hitos no contiene un diccionario"
assert hitos.cuantos() is 2, "El número de hitos es incorrecto"
def test_should_return_hitos_correctly_and_raise_error():
hitos = HitosIV()
assert hitos.uno(0)["file"] == "0.Repositorio"
try:
zipi = hitos.uno(-1)
except Exception as fallo:
assert type(fallo) is IndexError
try:
zipi = hitos.uno(99)
except Exception as fallo:
assert type(fallo) is IndexError