def test_after(self): # This isn't a valid sequence of moves, but it tests # out the board manipulation functions. self.assertEquals( terratri.boardToGrid(' _B ' ' L ' ' Rr ' ' . ' ' . '), terratri.after('nnEFfeSF'))
def test_toGrid(self): self.assertEquals( [[' ', ' ', '_', '_', ' '], [' ', ' ', 'b', 'B', ' '], [' ', 'r', ' ', ' ', ' '], [' ', '.', ' ', ' ', ' '], [' ', 'R', '.', ' ', ' ']], terratri.boardToGrid(' __ ' ' bB ' ' r ' ' . ' ' R. '))
def test_after(self): # This isn't a valid sequence of moves, but it tests # out the board manipulation functions. self.assertEquals( terratri.boardToGrid( ' _B ' ' L ' ' Rr ' ' . ' ' . '), terratri.after('nnEFfeSF'))
def test_toGrid(self): self.assertEquals( [[' ', ' ', '_', '_', ' '], [' ', ' ', 'b', 'B', ' '], [' ', 'r', ' ', ' ', ' '], [' ', '.', ' ', ' ', ' '], [' ', 'R', '.', ' ', ' ']], terratri.boardToGrid( ' __ ' ' bB ' ' r ' ' . ' ' R. '))
def validSteps(self): if self.game.whoseTurn: grid = terratri.boardToGrid(self.game.board) return terratri.validSteps(self.game.whoseTurn, grid, self.game.steps) else: return {}