Skip to content

Commit

Permalink
Merge pull request jwlodek#104 from readmodifywrite/master
Browse files Browse the repository at this point in the history
Add unit test for write method
  • Loading branch information
jwlodek authored Mar 27, 2021
2 parents 4b3e064 + 9798282 commit 180fe9f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_ui_implementations/test_text_block_imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,20 @@ def test_set_text(SCROLLTEXTBLOCK):
assert cursor_x == max_left


def test_write(SCROLLTEXTBLOCK):
text_box = SCROLLTEXTBLOCK('')

text_box.write('Line1\nLine2\nLine3\n')
assert text_box.get_current_line() == 'Line1'
text_box._move_down()
assert text_box.get_current_line() == 'Line2'
text_box._move_down()
assert text_box.get_current_line() == 'Line3'

text_box.write('Line4\n')
text_box._move_down()
assert text_box.get_current_line() == 'Line4'

def test_move_down(SCROLLTEXTBLOCK):
text_box = SCROLLTEXTBLOCK('Hello World\nTest')

Expand Down

0 comments on commit 180fe9f

Please sign in to comment.