From c72ce15d5941aaa3384a1a160996b0c92ec0efef Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Thu, 19 Aug 2010 10:51:16 +0200 Subject: Add helper to set the fake vim cursor in tests. --- tests/test_rst_tables.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_rst_tables.py b/tests/test_rst_tables.py index 0517769..f57761f 100644 --- a/tests/test_rst_tables.py +++ b/tests/test_rst_tables.py @@ -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') @@ -186,6 +189,5 @@ This is paragraph text *before* the table. 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) -- cgit v1.2.3