Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
Add helper to set the fake vim cursor in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
nvie committed Aug 19, 2010
1 parent bc3620a commit c72ce15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_rst_tables.py
Expand Up @@ -29,11 +29,14 @@ class TestRSTTableFormatter(unittest.TestCase):
def setUp(self):
# Default vim cursor for all tests is at line 4
vim.current = mock.Mock()
vim.current.window.cursor = (4, 0)
self.set_vim_cursor(4, 0)

def tearDown(self):
del vim.current

def set_vim_cursor(self, row, col):
vim.current.window.cursor = (row, col)

def read_fixture(self, name):
return open(os.path.join('tests/fixtures/', name + '.txt'),
'r').read().split('\n')
Expand Down Expand Up @@ -186,6 +189,5 @@ def testCreateTable(self):
This is paragraph text *after* the table, with
a line ending.
""".split('\n')
vim.current.window.cursor = (4, 10)
create_table()
self.assertEquals(expect, vim.current.buffer)

0 comments on commit c72ce15

Please sign in to comment.