Commit Graph

50 Commits

Author SHA1 Message Date
ZyX fa217185cf Encode vim statusline to &encoding before returning
Partially fixes #1072
2014-09-14 14:26:42 +04:00
ZyX 05cb133dd4 Replace g:powerline_config_path Vim variable with …_paths list
This is for consistency with other powerline bindings that now all do have a way 
to specify a list of paths.
2014-09-05 22:13:51 +04:00
ZyX c5ca1b23c4 Use class setup/teardown methods to use vim module mock 2014-09-05 20:00:19 +04:00
ZyX 7bf025ca2b Add `exclude_/include_function` support
This is first step towards fixing #1046.
2014-09-05 20:00:19 +04:00
ZyX bc557bd656 Use replace_item to add module `bar` to sys.modules
Tests should not leave modified environment.
2014-09-04 21:38:49 +04:00
ZyX 06211cbe63 Unify imports
Now imports follow the following structure:

1. __future__ line: exactly one line allowed:

        from __future__ import (unicode_literals, division, absolute_import, print_function)

   (powerline.shell is the only exception due to problems with argparse).
2. Standard python library imports in a form `import X`.
3. Standard python library imports in a form `from X import Y`.
4. and 5. 2. and 3. for third-party (non-python and non-powerline imports).
6. 3. for powerline non-test imports.
7. and 8. 2. and 3. for powerline testing module imports.

Each list entry is separated by exactly one newline from another import. If
there is module docstring it goes between `# vim:` comment and `__future__`
import. So the structure containing all items is the following:

    #!/usr/bin/env python
    # vim:fileencoding=utf-8:noet

    '''Powerline super module'''

    import sys

    from argparse import ArgumentParser

    import psutil

    from colormath.color_diff import delta_e_cie2000

    from powerline.lib.unicode import u

    import tests.vim as vim_module

    from tests import TestCase

.
2014-09-01 00:25:24 +04:00
ZyX 2505d0b827 Implement segment truncation
Closes #161 (requires implementation for specific segments though)
2014-08-30 18:22:52 +04:00
ZyX d6c603daf0 Add support for `segment.expand`
Closes #154
2014-08-30 18:22:46 +04:00
ZyX bfa335d96a Fix typo in test_configuration.py 2014-08-30 17:59:58 +04:00
ZyX 41476544ca Replace `name` and `module` keys with `function` key
Fixes #1031
2014-08-29 23:13:10 +04:00
ZyX 356cb43ea2 Add `powerline_segment_datas` attribute
Fixes #1035
2014-08-29 20:17:23 +04:00
ZyX 075eb8420e Add tests 2014-08-21 23:32:43 +04:00
ZyX 88a0b9075c Remove unused vim import 2014-08-21 23:32:43 +04:00
ZyX 1afab26cec Test that VimPowerline.add_local_theme works 2014-08-12 20:48:49 +04:00
ZyX bdde4ae99f Implement theme hierarchy
Fixes #783
2014-08-06 00:05:04 +04:00
ZyX 0f4e1bafda Refactor config_mock module to not use globals and fix tests 2014-08-05 13:56:02 +04:00
ZyX 16c01e8d64 Add support for display option 2014-08-02 18:37:22 +04:00
ZyX a279ea236c Also check error messages 2014-07-26 01:46:54 +04:00
ZyX f5735148e8 Add group aliasing and colorscheme hierarchy tests 2014-07-12 14:22:23 +04:00
ZyX 3ebf9c1a81 Use highlighted_string function to define segments 2014-07-12 14:08:05 +04:00
ZyX 576971c5f1 Fix test class name in test_configuration 2014-07-12 13:48:04 +04:00
ZyX c570a98065 Add watcher option
Ref #818
2014-06-28 21:10:15 +04:00
ZyX 6f6c1fb90c Add tests 2014-06-25 20:05:24 +04:00
ZyX 515df615bf Add some basic tests 2014-06-24 23:36:50 +04:00
ZyX f02807ffa4 Rename test_configuration to test_provided_config_files 2014-06-24 21:38:07 +04:00
ZyX 5c33de7a24 Also test zsh local themes 2014-02-16 20:52:22 +04:00
ZyX 73d7b0db08 Add functional tests for plugin themes 2014-01-11 11:51:58 +04:00
ZyX 4f80468645 Fix tests broken due to jobnum introduction 2014-01-10 23:17:06 +04:00
Kim Silkebækken 74d4ee9669 Update tests
Unit tests are not run on external segments. When external segments are
moved out of the core repo the extra test code won't be needed.
2013-08-20 16:48:54 +02:00
ZyX 962a1b6fc2 Fix tests 2013-05-19 13:17:59 +04:00
ZyX dfaf8c3b3a Fix messages 2013-05-19 13:17:58 +04:00
ZyX ebd122d4ac Unfinished attempt to adapt tests to new code 2013-05-19 13:17:58 +04:00
ZyX 467bc53589 Also fix bash tests 2013-05-02 16:01:44 +04:00
Kim Silkebækken 7864acb70b Update tests 2013-04-11 11:52:54 +02:00
ZyX 3ebc16a48c Replace pl.environ/getcwd/home with segment_info 2013-03-30 21:55:00 +04:00
ZyX 7646c949e2 Automatically reload configuration
Needs testing
2013-03-25 18:24:17 +04:00
ZyX 80ddbfbf9a Split Powerline.__init__ into __init__ and create_renderer
Target: with long-living Powerline objects periodically reload configuration 
recreating renderer. Use file watchers to watch for configuration. Configuration 
should be able to be safely reloaded in non-blocking mode in a separate thread 
up to the time when it comes to recreating renderer.

This commit does not add anything that actually reloads the configuration, 
multiple runs of .create_renderer were not tested.
2013-03-25 18:24:16 +04:00
ZyX ed435f8063 Add required pl argument to segments
Fixes #340
Ref #330
2013-03-24 19:44:01 +04:00
ZyX c4e5ff8b49 Added support for all powerline prompts (in2, out, rewrite)
Also fixed problem with prompt not really updating.

Fixes #141
2013-03-24 05:23:33 +04:00
ZyX b1f9edab4c Remove get_segment_info and passing segment_info through globals 2013-03-24 05:23:33 +04:00
ZyX 260a0dafcb Add tests for the constantly recreated *Powerline instances 2013-03-19 00:42:32 +04:00
ZyX b0495d028f Do not let daemon threads be stopped while being updated 2013-03-18 07:56:25 +04:00
ZyX b2b05cb81c Removed underscore_to_camelcase
No need to bother both developers (that need to create class names compatible 
with file name, which is not obvious if not looking into main Powerline class) 
and computer (that needs to recompute class name each time) if it is possible to 
bother only developers (or only computer, but this contributes to higher startup 
times).

About not obvious: when you look into zsh_prompt.py and see only 
ZshPromptRenderer name you only think that powerline upstream is following 
strict code style. You don’t think there is a technical reason for such naming, 
like you don’t think there is technical reason for having blank lines. When you 
look into zsh_prompt.py and see `renderer = ZshPromptRenderer` it is obvious 
that there is technical reason for writing code this way because new variable is 
never used in the module itself.
2013-03-11 22:22:18 +04:00
ZyX 2c445a9356 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)
2013-03-11 22:09:34 +04:00
Kim Silkebækken 111eaa27e8 Combine vim modelines and Python encoding declarations
Ref #314
2013-03-11 10:40:09 +01:00
Kim Silkebækken 6748701fcb Add vim modelines to all Python files
Added with `sed -i '2i# vim:fenc=utf-8:noet' `find -name '*.py'`` and
fixed in a couple of files without the UTF-8 encoding on top.

Ref #314
2013-03-11 08:11:25 +01:00
ZyX aa0a8bf76d Make tests support python2.6
Old unittest is not working for unknown reason, using unittest2 instead
2013-03-03 21:03:40 +01:00
ZyX 0a05b2961a Add support for with: statement to tests.vim
Also made everything use new vim_module._with where possible
2013-03-03 21:03:34 +01:00
ZyX c429d9eeb2 Omit using sys.modules if possible
Does not work though: still TypeError due to some global in multiproccessing
that got None
2013-03-03 21:03:34 +01:00
ZyX 584755765b Start adding tests
Tests are temporary disabled on all branches except tests (does not really work
though, needs travis.yml in all branches).
2013-03-03 21:03:19 +01:00