def test_cell_with_three_live_neighbours_reproduces(self): """Test: 'Cell with three neighbours becomes alive.'""" cell = Cell(state=CellState.DEAD) state = cell.get_next_state(3) self.assertEquals(state, CellState.ALIVE)
def test_cell_with_zero_neighbours_dies(self): """Tests 'Cell with no neighbours'""" cell = Cell(state=CellState.ALIVE) state = cell.get_next_state(0) self.assertEquals(state, CellState.DEAD)
def test_cell_with_seven_neighbours_dies(self): """Test: 'Cell with more than three neighbours dies'""" cell = Cell(state=CellState.ALIVE) state = state = cell.get_next_state(7) self.assertEquals(state, CellState.DEAD)
def test_cell_with_three_neighbours_lives_on(self): """Test: 'Cell with three neighbours dies'""" cell = Cell(state=CellState.ALIVE) state = state = cell.get_next_state(3) self.assertEquals(state, CellState.ALIVE)
def test_cell_lives_on_with_two_neighbours(self): """Test: 'Cell lives on with two neighbours.'""" cell = Cell(state=CellState) state = cell.get_next_state(2) self.assertEquals(state, CellState.ALIVE)
def test_cell_dies_when_only_one_neighbor(self): """Test: 'Cell with one neighbour'""" cell = Cell(state=CellState.ALIVE) state = cell.get_next_state(1) self.assertEquals(state, CellState.DEAD)