1
0
mirror of https://github.com/wting/autojump synced 2026-03-02 03:49:26 +00:00

add helper functions unit tests

This commit is contained in:
William Ting
2013-12-31 18:39:45 -06:00
parent 80d7ab660f
commit b3162c917b
3 changed files with 17 additions and 3 deletions

View File

@@ -22,6 +22,7 @@ from autojump_utils import create_dir
from autojump_utils import decode
from autojump_utils import first
from autojump_utils import get_pwd
from autojump_utils import get_tab_entry_info
from autojump_utils import has_uppercase
from autojump_utils import in_bash
from autojump_utils import last
@@ -157,5 +158,18 @@ class FileSystemIntegrationTests(TestCase):
assert_true(os.path.exists(dst))
def HelperFunctionsUnitTests(TestCase):
def test_get_needle(self):
assert_equal(('foo', None, None), get_tab_entry_info('foo__', '__'))
def test_get_index(self):
assert_equal(('foo', 2, None), get_tab_entry_info('foo__2', '__'))
def test_get_path(self):
assert_equal(
('foo', 3, '/foo'),
get_tab_entry_info('foo__3__/foo', '__'))
if __name__ == "__main__":
run()