Ejemplo n.º 1
0
def test_day9_test5():
    """Can change relative base"""
    q = Queue()
    c = Computer([109,19,204,-34],None,q)
    c.relative_base = 2000
    c._state[1985] = 1234
    c.step()
    c.step()
    assert q.get()==1234
Ejemplo n.º 2
0
def test_day2_test1():
    state1 = [1, 9, 10, 3, 2, 3, 11, 0, 99, 30, 40, 50]
    c = Computer(state1, None, None)
    c.step()
    assert c.state== [1, 9, 10, 70, 2, 3, 11, 0, 99, 30, 40, 50]
    c.step()
    assert c.state== [3500, 9, 10, 70, 2, 3, 11, 0, 99, 30, 40, 50]
    c.step()
    assert c.has_stopped