コード例 #1
0
			Powerline(logger=get_logger(), ext='wm', renderer_module='pango_markup', run_once=True).render()
		reload(common)


old_cwd = None
saved_get_config_paths = None


def setUpModule():
	global old_cwd
	global saved_get_config_paths
	import powerline
	saved_get_config_paths = powerline.get_config_paths
	path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'powerline', 'config_files')
	powerline.get_config_paths = lambda: [path]
	old_cwd = os.getcwd()


def tearDownModule():
	global old_cwd
	global saved_get_config_paths
	import powerline
	powerline.get_config_paths = saved_get_config_paths
	os.chdir(old_cwd)
	old_cwd = None


if __name__ == '__main__':
	from tests.modules import main
	main()
コード例 #2
0
ファイル: test_selectors.py プロジェクト: jcronq/linuxEnv
class TestVim(TestCase):
    def test_single_tab(self):
        pl = Pl()
        single_tab = partial(self.vim.single_tab,
                             pl=pl,
                             segment_info=None,
                             mode=None)
        with vim_module._with('tabpage'):
            self.assertEqual(single_tab(), False)
        self.assertEqual(single_tab(), True)

    @classmethod
    def setUpClass(cls):
        sys.path.insert(
            0,
            os.path.abspath(
                os.path.join(os.path.dirname(os.path.dirname(__file__)),
                             'vim_sys_path')))
        from powerline.selectors import vim
        cls.vim = vim

    @classmethod
    def tearDownClass(cls):
        sys.path.pop(0)


if __name__ == '__main__':
    from tests.modules import main
    main()