Commit Graph

327 Commits

Author SHA1 Message Date
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 8588885b04 In vim tests check for printed messages 2014-09-04 08:32:36 +04:00
ZyX b638a8e1c9 Add tests for is_watching method
Currently they fail for uv-based watcher.
2014-09-02 21:58:42 +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 0da40f08a5 Fix syntastic error 2014-08-30 17:59:58 +04:00
ZyX 8d3376ce07 Ultimately disable pyuv watcher tests 2014-08-30 15:49:50 +04:00
ZyX 560600fca9 Use shutil.rmtree in tests 2014-08-30 15:47:31 +04:00
ZyX 0ee5293e1a Add tests for libuv-based watcher
Four possible results of running tests (first three are errors):

- “The change to inotify/file2 was not detected” on line 84: most common
- “Spurious change detected” at line 82 (uncommon, usually fixed by sleeping
  before running test in do_test_for_change)
- “The change to inotify was not detected” in tree watcher test (e.g. from line
  131) (very rare)
- All OK.
2014-08-30 15:45:30 +04:00
ZyX 10e8d9bb15 Do not use &> in #!/bin/sh scripts 2014-08-29 23:21:19 +04:00
ZyX 41476544ca Replace `name` and `module` keys with `function` key
Fixes #1031
2014-08-29 23:13:10 +04:00
ZyX 5bd543ae89 Do not run daemon when running with ONLY_TEST_TYPE=nodaemon 2014-08-29 23:13:10 +04:00
ZyX 9a0e100ca0 Specify -p argument in run function when running shell tests 2014-08-29 23:13:10 +04:00
ZyX 4c95928c96 Split shell tests into files
I am mostly interested in running all python and vim tests separately from other 
tests.
2014-08-29 22:22:39 +04:00
ZyX 849c34ea72 Replace all unicode defaults with defaults from ASCII theme
Closes #1034
2014-08-29 20:47:44 +04:00
ZyX 9fe0b66125 Merge branch 'top-theme-extend' into develop 2014-08-29 20:25:51 +04:00
ZyX 356cb43ea2 Add `powerline_segment_datas` attribute
Fixes #1035
2014-08-29 20:17:23 +04:00
ZyX 125f309724 Fix width used for tabline
Fixes #1033
2014-08-29 18:32:58 +04:00
ZyX 53ab31eeb8 Use setUpClass/tearDownClass to deal with VCS repositories 2014-08-29 00:28:41 +04:00
ZyX 70fabdc02b Use SkipTest for skipping tests 2014-08-29 00:22:28 +04:00
ZyX 323f0c4e22 Use __import__ checks for skipping bzr/mercurial
Closes #1015
2014-08-29 00:22:05 +04:00
ZyX 9658e45eee Use &encoding as powerline encoding in Vim
Among other benefits (i.e. correct fall back to ascii theme when Vim uses
non-unicode encoding) this should also fix travis tests: apparently travis is
not setting LANG or similar environment variables to some unicode locale, so
tests are failing.
2014-08-27 23:52:09 +04:00
ZyX e02647560a Move LANG setting to run function, remove useless BINDFILE variable 2014-08-27 23:52:09 +04:00
ZyX 289a08c539 Replace .replace(' ', NBSP) call with self.escape call
Dividers need to be escaped as well.

Fixes #1027
2014-08-27 23:52:09 +04:00
ZyX d32b798c11 Add `use_non_breaking_spaces` theme option, use it in ascii theme 2014-08-27 23:52:09 +04:00
ZyX d88d87f6af Do not make daemon output zero byte
This byte is useless and can be seen in zsh output (strange that it did not 
cause bugs so far, at least none I know about). It may have been needed if any 
client was supposed to hold connection with daemon for a few runs, but all 
current clients work in “request → output response → exit” fashion without 
caring about terminating newline and definitely without preserving connection to 
daemon accross runs.
2014-08-26 21:13:56 +04:00
ZyX e4565dd3e8 Make attached_clients segment use provided tmux bindings 2014-08-24 21:07:19 +04:00
Matthew M. Keeler 88515ab472 Show Count of Attached Tmux Sessions
- This segment displays the number of attached tmux clients to the
  currently running session.
- The minimum argument is used to specify a threshold for when the
  segment should be visible.

Fixes #661
Closes #662

Conflicts:
	docs/source/index.rst
	powerline/config_files/colorschemes/shell/default.json
	powerline/config_files/colorschemes/shell/solarized.json
	powerline/config_files/colorschemes/tmux/default.json
	powerline/config_files/colorschemes/vim/default.json
	powerline/config_files/colorschemes/vim/solarized.json
	powerline/config_files/colorschemes/wm/default.json
	tests/test_segments.py
2014-08-24 20:56:59 +04:00
ZyX 45d2053053 Do not specify $PYTHON when running python client
It is not needed: in the environment where it is run only python is the one
linked in tests/shell/path.
2014-08-24 19:57:58 +04:00
ZyX d7a674deaa Add support for shell-specific path shortening
Fixes #502
2014-08-24 19:54:28 +04:00
ZyX 04c0030fe1 Refactor cwd segment into a class and add shorten_home argument 2014-08-24 19:50:54 +04:00
ZyX 58057c95b9 Add a directory that will make fish_update_completions not launch 2014-08-24 17:14:37 +04:00
ZyX 0af5e2d2ca Test mode support in fish
WARNING: Requires development version of fish. Since fish is not tested in
travis it is probably OK.
2014-08-24 17:14:37 +04:00
ZyX 54672aace0 Make COMMAND_PATTERN consistent with other arguments 2014-08-24 17:14:37 +04:00
ZyX 68ecd81edd Wait until fish_update_completions finishes 2014-08-24 16:58:35 +04:00
ZyX 5bc1f75b70 Add support for vim.eval('v:version') in test bindings 2014-08-24 13:41:54 +04:00
ZyX 173c4d6e76 Add internal_ip segment
Closes #857
2014-08-24 01:20:25 +04:00
ZyX 20e9575c17 Do not try to test ipython if it is not available 2014-08-23 16:24:16 +04:00
ZyX 1b56179676 Disable dash tests in travis 2014-08-23 16:02:04 +04:00
ZyX ebc98977ae Make test_shells/test.sh compatible with dash 2014-08-23 16:00:34 +04:00
ZyX 9b7052bf3e Do not execute all tests in travis 2014-08-23 15:51:35 +04:00
ZyX 0232d3215b Add --socket argument to all clients
Makes it not needed to kill daemon for testing, but disables implicit
`powerline-config shell command` testing.
2014-08-23 15:19:00 +04:00
ZyX 77a7a26782 Do not require scripts/powerline
It may be immediately moved to bin/ sometimes or not compiled at all for some
reason.
2014-08-23 15:19:00 +04:00
ZyX 042d542231 Also test whether running daemon is successfull without arguments 2014-08-23 15:19:00 +04:00
ZyX b9360a083a Make tests test powerline daemon with valid python and all clients 2014-08-23 15:19:00 +04:00
ZyX 6481f1b65e Always specify all keys in segment_info 2014-08-22 21:03:59 +04:00
ZyX da48e9d84e Add tests 2014-08-22 09:08:58 +04:00