def test_run_commands_simple_test_0():
    input_code = [1, 0, 0, 3, 99]
    intcode = IntCode(input_code)
    intcode.run_commands()
    assert intcode._memory == [1, 0, 0, 2, 99]
def test_run_commands_complex():
    input_code = [1, 9, 10, 3, 2, 3, 11, 0, 99, 30, 40, 50]
    intcode = IntCode(input_code)
    intcode.run_commands()
    assert intcode._memory == [3500, 9, 10, 70, 2, 3, 11, 0, 99, 30, 40, 50]
def test_run_commands_simple_test_4():
    input_code = [1, 1, 1, 4, 99, 5, 6, 0, 99]
    intcode = IntCode(input_code)
    intcode.run_commands()
    assert intcode._memory == [30, 1, 1, 4, 2, 5, 6, 0, 99]
def test_run_commands_invalid_instruction():
    input_code = [5, 0, 0, 0, 99]
    intcode = IntCode(input_code)
    with pytest.raises(UnknownInstruction):
        intcode.run_commands()
def test_run_commands_simple_test_3():
    input_code = [2, 4, 4, 5, 99, 0]
    intcode = IntCode(input_code)
    intcode.run_commands()
    assert intcode._memory == [2, 4, 4, 5, 99, 9801]