def test_update_long_time_open(self): eca = ECA(45, 14, (0, 1)) lattice = [1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1] expected = [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1] if lattice in eca: for n in range(1000): eca._unsafe_update(lattice) self.assertEqual(expected, lattice)
def test_unsafe_update_index(self): eca = ECA(30, 5) lattice = [0, 0, 0, 1, 0] eca._unsafe_update(lattice, index=-1) self.assertEqual([0, 0, 0, 1, 1], lattice)