def testNextToTwo(self): cells = game.create_cells(game.ROWS, game.COLUMNS) cells[0][1] = True cells[1][0] = True self.assertEqual(False, game.should_live(0, 0, cells), "Should stay dead") cells[0][0] = True self.assertEqual(True, game.should_live(0, 0, cells), "Should stay alive")
def testNextToMoreThanThree(self): cells = game.create_cells(game.ROWS, game.COLUMNS) cells[0][0] = True cells[0][1] = True cells[0][2] = True cells[1][0] = True self.assertEqual(False, game.should_live(1, 1, cells), "Should stay dead") cells[0][0] = True self.assertEqual(False, game.should_live(1, 1, cells), "Should die")
def testCellIsolated(self): cells = game.create_cells(game.ROWS, game.COLUMNS) self.assertEqual(False, game.should_live(0, 0, cells), "Should stay dead") cells[0][0] = True self.assertEqual(False, game.should_live(0, 0, cells), "Should die")