diff --git a/tests/test_configuration.py b/tests/test_configuration.py index f8053fb6..19b9bb04 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -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 diff --git a/tests/vim.py b/tests/vim.py index beec40de..91a94886 100644 --- a/tests/vim.py +++ b/tests/vim.py @@ -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