aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Driessen <vincent@datafox.nl>2010-08-19 10:51:16 +0200
committerVincent Driessen <vincent@datafox.nl>2010-08-19 10:51:16 +0200
commitc72ce15d5941aaa3384a1a160996b0c92ec0efef (patch)
tree55bf9a5363cf9cb48a2bf2bbe04e71553f4a7d52
parentbc3620adf956828562071f9feafc5923de567ea9 (diff)
downloadvim-rst-tables-c72ce15d5941aaa3384a1a160996b0c92ec0efef.tar.gz
vim-rst-tables-c72ce15d5941aaa3384a1a160996b0c92ec0efef.tar.bz2
vim-rst-tables-c72ce15d5941aaa3384a1a160996b0c92ec0efef.zip
Add helper to set the fake vim cursor in tests.
-rw-r--r--tests/test_rst_tables.py6
1 files 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)