mirror of
https://github.com/powerline/powerline.git
synced 2025-07-29 08:45:15 +02:00
Move tests run by run_python_tests to tests/test_python
This commit is contained in:
parent
53a7d1046e
commit
f3bf749467
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
enter_suite python
|
enter_suite python
|
||||||
|
|
||||||
for file in tests/test_*.py ; do
|
for file in tests/test_python/test_*.py ; do
|
||||||
test_name="${file##*/test_}"
|
test_name="${file##*/test_}"
|
||||||
if ! ${PYTHON} $file --verbose --catch ; then
|
if ! ${PYTHON} $file --verbose --catch ; then
|
||||||
fail "${test_name%.py}" F "Failed test(s) from $file"
|
fail "${test_name%.py}" F "Failed test(s) from $file"
|
||||||
|
@ -840,7 +840,7 @@ class TestVim(TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'vim_sys_path')))
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'vim_sys_path')))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
@ -704,7 +704,7 @@ class TestVCS(TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.powerline_old_cwd = os.getcwd()
|
cls.powerline_old_cwd = os.getcwd()
|
||||||
os.chdir(os.path.dirname(__file__))
|
os.chdir(os.path.dirname(os.path.dirname(__file__)))
|
||||||
call(['git', 'init', '--quiet', GIT_REPO])
|
call(['git', 'init', '--quiet', GIT_REPO])
|
||||||
assert os.path.isdir(GIT_REPO)
|
assert os.path.isdir(GIT_REPO)
|
||||||
call(['git', 'config', '--local', 'user.name', 'Foo'], cwd=GIT_REPO)
|
call(['git', 'config', '--local', 'user.name', 'Foo'], cwd=GIT_REPO)
|
@ -9,7 +9,7 @@ from tests.modules import TestCase
|
|||||||
from tests.modules.lib.fsconfig import FSTree
|
from tests.modules.lib.fsconfig import FSTree
|
||||||
|
|
||||||
|
|
||||||
FILE_ROOT = os.path.join(os.path.dirname(__file__), 'cfglib')
|
FILE_ROOT = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'cfglib')
|
||||||
|
|
||||||
|
|
||||||
class LoadedList(list):
|
class LoadedList(list):
|
@ -454,7 +454,7 @@ def setUpModule():
|
|||||||
global __file__
|
global __file__
|
||||||
old_cwd = os.getcwd()
|
old_cwd = os.getcwd()
|
||||||
__file__ = os.path.abspath(__file__)
|
__file__ = os.path.abspath(__file__)
|
||||||
os.chdir(os.path.dirname(__file__))
|
os.chdir(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
|
||||||
def tearDownModule():
|
def tearDownModule():
|
@ -46,7 +46,7 @@ def get_logger(stream=None):
|
|||||||
class TestVimConfig(TestCase):
|
class TestVimConfig(TestCase):
|
||||||
def test_vim(self):
|
def test_vim(self):
|
||||||
from powerline.vim import VimPowerline
|
from powerline.vim import VimPowerline
|
||||||
cfg_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'powerline', 'config_files')
|
cfg_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'powerline', 'config_files')
|
||||||
buffers = (
|
buffers = (
|
||||||
(('bufoptions',), {'buftype': 'help'}),
|
(('bufoptions',), {'buftype': 'help'}),
|
||||||
(('bufname', '[Command Line]'), {}),
|
(('bufname', '[Command Line]'), {}),
|
||||||
@ -101,7 +101,7 @@ class TestVimConfig(TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'vim_sys_path')))
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'vim_sys_path')))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
@ -182,7 +182,7 @@ def setUpModule():
|
|||||||
global saved_get_config_paths
|
global saved_get_config_paths
|
||||||
import powerline
|
import powerline
|
||||||
saved_get_config_paths = powerline.get_config_paths
|
saved_get_config_paths = powerline.get_config_paths
|
||||||
path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'powerline', 'config_files')
|
path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'powerline', 'config_files')
|
||||||
powerline.get_config_paths = lambda: [path]
|
powerline.get_config_paths = lambda: [path]
|
||||||
old_cwd = os.getcwd()
|
old_cwd = os.getcwd()
|
||||||
|
|
@ -1291,7 +1291,11 @@ class TestVim(TestCase):
|
|||||||
pl = Pl()
|
pl = Pl()
|
||||||
segment_info = vim_module._get_segment_info()
|
segment_info = vim_module._get_segment_info()
|
||||||
self.assertEqual(self.vim.file_size(pl=pl, segment_info=segment_info), '0 B')
|
self.assertEqual(self.vim.file_size(pl=pl, segment_info=segment_info), '0 B')
|
||||||
with vim_module._with('buffer', os.path.join(os.path.dirname(__file__), 'empty')) as segment_info:
|
with vim_module._with(
|
||||||
|
'buffer',
|
||||||
|
os.path.join(
|
||||||
|
os.path.dirname(os.path.dirname(__file__)), 'empty')
|
||||||
|
) as segment_info:
|
||||||
self.assertEqual(self.vim.file_size(pl=pl, segment_info=segment_info), '0 B')
|
self.assertEqual(self.vim.file_size(pl=pl, segment_info=segment_info), '0 B')
|
||||||
|
|
||||||
def test_file_opts(self):
|
def test_file_opts(self):
|
||||||
@ -1599,7 +1603,7 @@ class TestVim(TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'vim_sys_path')))
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'vim_sys_path')))
|
||||||
from powerline.segments import vim
|
from powerline.segments import vim
|
||||||
cls.vim = vim
|
cls.vim = vim
|
||||||
from powerline.segments.common import vcs
|
from powerline.segments.common import vcs
|
||||||
@ -1664,7 +1668,7 @@ def setUpModule():
|
|||||||
global __file__
|
global __file__
|
||||||
old_cwd = os.getcwd()
|
old_cwd = os.getcwd()
|
||||||
__file__ = os.path.abspath(__file__)
|
__file__ = os.path.abspath(__file__)
|
||||||
os.chdir(os.path.dirname(__file__))
|
os.chdir(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
|
||||||
def tearDownModule():
|
def tearDownModule():
|
@ -22,7 +22,7 @@ class TestVim(TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'vim_sys_path')))
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'vim_sys_path')))
|
||||||
from powerline.selectors import vim
|
from powerline.selectors import vim
|
||||||
cls.vim = vim
|
cls.vim = vim
|
||||||
|
|
@ -231,7 +231,7 @@ old_cwd = None
|
|||||||
def setUpModule():
|
def setUpModule():
|
||||||
global old_cwd
|
global old_cwd
|
||||||
old_cwd = os.getcwd()
|
old_cwd = os.getcwd()
|
||||||
os.chdir(os.path.dirname(__file__))
|
os.chdir(os.path.dirname(os.path.dirname(__file__)))
|
||||||
os.mkdir(INOTIFY_DIR)
|
os.mkdir(INOTIFY_DIR)
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user