adicionar teste para metodo '__str__()'
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
from random import randint
|
from random import randint
|
||||||
from modules.agente import Agente
|
from modules.agente import Agente
|
||||||
from modules.mapa import Mapa, MAX_DIMENSAO, MIN_DIMENSAO
|
from modules.mapa import Mapa, MIN_DIMENSAO
|
||||||
|
|
||||||
|
|
||||||
class Test_Mapa:
|
class Test_Mapa:
|
||||||
@ -38,3 +38,14 @@ class Test_Mapa:
|
|||||||
if pos_y >= mapa.dimensao[0]:
|
if pos_y >= mapa.dimensao[0]:
|
||||||
pos_y = 0
|
pos_y = 0
|
||||||
assert agente is mapa.mundo[pos_x][pos_y]
|
assert agente is mapa.mundo[pos_x][pos_y]
|
||||||
|
|
||||||
|
def test_stringify(self):
|
||||||
|
"""
|
||||||
|
teste para metodo __str__()
|
||||||
|
"""
|
||||||
|
mapa: Mapa = Mapa((16, 16))
|
||||||
|
assert (
|
||||||
|
mapa.__str__()
|
||||||
|
== f"Dados Mapa ({mapa.id_mapa})\n \
|
||||||
|
\tdimensao: {mapa.dimensao[0]} x {mapa.dimensao[1]}"
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user