From 2c445a935621124e33ddd1e2140b9c5c982ed7db Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 11 Mar 2013 22:09:34 +0400 Subject: [PATCH] Add more tests to test_configuration Dynamic configuration tests. Purpose: make sure that default configuration does not throw. Tests catch only very trivial problems (like missing imports after refactoring) --- tests/test_configuration.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 5851ec3f..1ae26355 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -57,6 +57,35 @@ class TestConfig(TestCase): from powerline.shell import ShellPowerline with replace_module_attr(common, 'urllib_read', urllib_read): ShellPowerline(Args(ext=['tmux'])).renderer.render() + reload(common) + + def test_zsh(self): + from powerline.shell import ShellPowerline + ShellPowerline(Args(last_pipe_status=[1, 0], ext=['shell'], renderer_module='zsh_prompt')).renderer.render() + + def test_bash(self): + from powerline.shell import ShellPowerline + ShellPowerline(Args(last_exit_code=1, ext=['shell'], renderer_module='bash_prompt', config=[('ext', {'shell': {'theme': 'default_leftonly'}})])).renderer.render() + + def test_ipython(self): + from powerline.ipython import IpythonPowerline + + class IpyPowerline(IpythonPowerline): + path = None + config_overrides = None + theme_overrides = {} + + IpyPowerline().renderer.render() + + def test_wm(self): + from powerline.segments import common + from imp import reload + reload(common) + from powerline.shell import ShellPowerline + with replace_module_attr(common, 'urllib_read', urllib_read): + from powerline import Powerline + Powerline(ext='wm', renderer_module='pango_markup').renderer.render() + reload(common) old_cwd = None