def test_jump_through_ladder_right(self): ## standing besides a ladder and jumping right a=[[0 for x in range(80)] for x in range (31)] h=Board() h.structure(a) h=Jumper() player_pos=[29,31] f=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,'X','X','X','X'] h.jumper(a,-3,player_pos,1,1,1,0,f) assert(a[29][28]=='P' and a[27][30]=='H')
def test_player_boundry_jump_left(self) : ## checks left jump near boundry try: a=[[0 for x in range(80)] for x in range (31)] h=Board() h.structure(a) h=Jumper() player_pos=[29,1] f=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,'X','X','X','X'] h.jumper(a,-3,player_pos,1,1,1,0,f) except IndexError as exc: pytest.fail(exc, pytrace=True)
def test_jump_from_ladder(self): ## what happens if jump is pressed on a ladder try: a=[[0 for x in range(80)] for x in range (31)] h=Board() h.structure(a) h=Jumper() player_pos=[28,30] f=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,'X','X','X','X'] h.jumper(a,3,player_pos,1,1,1,0,f) assert(a[28][32]!='P') except IndexError as exc : pytest.fail(exc,pytrace=True)