def test_playercollectcoin(self): P = Player("Hello",1,ROWS - 2, COLS, 1, 0) newb = Board() array = [] pathexists = False testofthree = False numofcoins = 0 while True: pathexists,numofcoins,testofthree = newb.init(COLS,ROWS,array,P) if pathexists == True: break oldscore = P.getScore() temprow = ROWS-2 tempcol = 1 while True: if array[temprow][tempcol+1] == 3: break elif tempcol == COLS-4: temprow += 4 tempcol = P.getY() else: tempcol += 1 P.changeposn(temprow,tempcol) array[temprow][tempcol] = 4 if array[P.getX()][P.getY() + 1] == 3: P.changeposn(temprow,tempcol) array[temprow][tempcol] = 4 P.collectCoin() assert P.getScore() == oldscore + 5 running = False