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:
parent
89204d2a7b
commit
2c445a9356
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue