Example #1
0
def test_set_string_empty_tape_left_left_right_a():
    tape = Tape('B', ['a', 'b', 'X', 'B'], [])
    tape.move_left() 
    tape.move_left() 
    tape.move_right()
    tape.set_content('a') 
    assert "(['B', 'a'])@1" == str(tape)
Example #2
0
def test_set_content_empty_tape_left_left_right():
    tape = Tape('B', ['a', 'b', 'X', 'B'], [])
    tape.move_left() 
    tape.move_left() 
    tape.move_right()
    tape.set_content('a') 
    assert tape.get_content() == 'a'  
    assert tape.position == 1
    assert tape.content == ['B', 'a']
Example #3
0
def test_set_content_empty_tape():
    tape = Tape('B', ['a', 'b', 'X', 'B'], [])
    tape.set_content('a')
    assert tape.get_content() == 'a'
    assert tape.content == ['a']
    assert tape.position == 0