Selaa lähdekoodia

add helper functions unit tests

pull/252/head
William Ting 10 vuotta sitten
vanhempi
commit
b3162c917b
3 muutettua tiedostoa jossa 17 lisäystä ja 3 poistoa
  1. +2
    -2
      .gitignore
  2. +1
    -1
      Makefile
  3. +14
    -0
      tests/autojump_utils_test.py

+ 2
- 2
.gitignore Näytä tiedosto

@ -1,6 +1,6 @@
tags
bin/autojump.py
.coverage
*.pyc
*~
*.tar.gz
*.patch
tags

+ 1
- 1
Makefile Näytä tiedosto

@ -1,7 +1,7 @@
VERSION = $(shell grep -oE "[0-9]+\.[0-9]+\.[0-9]+" bin/autojump)
TAGNAME = release-v$(VERSION)
.PHONY: docs install uninstall lint tar
.PHONY: docs install uninstall lint tar test
install:
install.sh

+ 14
- 0
tests/autojump_utils_test.py Näytä tiedosto

@ -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()

Ladataan…
Peruuta
Tallenna