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)
This commit is contained in:
ZyX 2013-03-11 22:09:34 +04:00
parent 89204d2a7b
commit 2c445a9356
1 changed files with 29 additions and 0 deletions

View File

@ -57,6 +57,35 @@ class TestConfig(TestCase):
from powerline.shell import ShellPowerline from powerline.shell import ShellPowerline
with replace_module_attr(common, 'urllib_read', urllib_read): with replace_module_attr(common, 'urllib_read', urllib_read):
ShellPowerline(Args(ext=['tmux'])).renderer.render() 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 old_cwd = None