Update tests
Unit tests are not run on external segments. When external segments are moved out of the core repo the extra test code won't be needed.
This commit is contained in:
parent
e19a63aaa9
commit
74d4ee9669
|
@ -19,9 +19,16 @@ class TestConfig(TestCase):
|
|||
def test_vim(self):
|
||||
from powerline.vim import VimPowerline
|
||||
cfg_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'powerline', 'config_files')
|
||||
buffers = ((('bufoptions',), {'buftype': 'help'}), (('bufname', '[Command Line]'), {}), (('bufoptions',), {'buftype': 'quickfix'}))
|
||||
buffers = (
|
||||
(('bufoptions',), {'buftype': 'help'}),
|
||||
(('bufname', '[Command Line]'), {}),
|
||||
(('bufoptions',), {'buftype': 'quickfix'}),
|
||||
)
|
||||
with open(os.path.join(cfg_path, 'config.json'), 'r') as f:
|
||||
self.assertEqual(len(buffers), len(json.load(f)['ext']['vim']['local_themes']))
|
||||
local_themes_raw = json.load(f)['ext']['vim']['local_themes']
|
||||
# Don't run tests on external/plugin segments
|
||||
local_themes = dict((k, v) for (k, v) in local_themes_raw.items() if not '.' in k)
|
||||
self.assertEqual(len(buffers), len(local_themes))
|
||||
outputs = {}
|
||||
i = 0
|
||||
|
||||
|
|
|
@ -156,6 +156,9 @@ def command(cmd):
|
|||
elif cmd.startswith('hi '):
|
||||
sp = cmd.split()
|
||||
_highlights[sp[1]] = sp[2:]
|
||||
elif cmd.startswith('function! Powerline_plugin_ctrlp'):
|
||||
# Ignore CtrlP updating functions
|
||||
pass
|
||||
else:
|
||||
raise NotImplementedError
|
||||
|
||||
|
@ -169,6 +172,8 @@ def eval(expr):
|
|||
elif expr.startswith('PowerlineRegisterCachePurgerEvent'):
|
||||
_buf_purge_events.add(expr[expr.find('"') + 1:expr.rfind('"') - 1])
|
||||
return "0"
|
||||
elif expr.startswith('exists('):
|
||||
return '0'
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue