Exemplo n.º 1
0
 def test_add_surround(self, target):
     map = target()
     map.add_surround((0, 0), [0, 1, 2, 3, 0, 0, 0, 0, 0], 1)
     actual = map.as_text((0, 0))
     expected = "_EX\n*#_\n___"
     assert actual == expected
Exemplo n.º 2
0
 def test_str(self, target):
     map = target()
     actual = str(map)
     expected = "_"
     assert actual == expected
Exemplo n.º 3
0
 def test_is_item(self, target):
     cell = target(const.TYPE_ITEM, 1)
     assert not cell.is_floor()
     assert not cell.is_character()
     assert not cell.is_block()
     assert cell.is_item()
Exemplo n.º 4
0
 def update(self, target):
     cell = target(const.TYPE_FLOOR, 1)
     cell.update(const.TYPE_BLOCK, 2)
     assert cell.celltype == const.TYPE_BLOCK
     assert cell.history[0] == (const.TYPE_FLOOR, 1)
Exemplo n.º 5
0
 def test_property(self, target):
     cell = target(const.TYPE_FLOOR, 1)
     assert cell.celltype == const.TYPE_FLOOR
     assert cell.turn == 1