~neovim-ppa/neovim-ppa/python-neovim

« back to all changes in this revision

Viewing changes to test/test_tabpage.py

  • Committer: Thiago de Arruda
  • Date: 2014-05-13 23:01:56 UTC
  • Revision ID: git-v1:cd7ef838ce097f060607a6d35ae6209615e175fd
Add license and update readme

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import os
2
 
from nose.tools import with_setup, eq_ as eq, ok_ as ok
3
 
from common import vim, cleanup
4
 
 
5
 
 
6
 
@with_setup(setup=cleanup)
7
 
def test_windows():
8
 
    vim.command('tabnew')
9
 
    vim.command('vsplit')
10
 
    eq(list(vim.tabpages[0].windows), [vim.windows[0]])
11
 
    eq(list(vim.tabpages[1].windows), [vim.windows[1], vim.windows[2]])
12
 
    eq(vim.tabpages[1].window, vim.windows[1])
13
 
    vim.current.window = vim.windows[2]
14
 
    eq(vim.tabpages[1].window, vim.windows[2])
15
 
 
16
 
 
17
 
@with_setup(setup=cleanup)
18
 
def test_vars():
19
 
    vim.current.tabpage.vars['python'] = [1, 2, {'3': 1}]
20
 
    eq(vim.current.tabpage.vars['python'], [1, 2, {'3': 1}])
21
 
    eq(vim.eval('t:python'), [1, 2, {'3': 1}])
22
 
 
23
 
 
24
 
@with_setup(setup=cleanup)
25
 
def test_valid():
26
 
    vim.command('tabnew')
27
 
    tabpage = vim.tabpages[1]
28
 
    ok(tabpage.valid)
29
 
    vim.command('tabclose')
30
 
    ok(not tabpage.valid)