1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

add has_uppercase() test

This commit is contained in:
William Ting 2013-12-31 17:41:12 -06:00
parent cc9b7c28cf
commit 59e494a066

View File

@ -12,6 +12,7 @@ from testify import run
import autojump_utils import autojump_utils
from autojump_utils import decode from autojump_utils import decode
from autojump_utils import first from autojump_utils import first
from autojump_utils import has_uppercase
from autojump_utils import in_bash from autojump_utils import in_bash
from autojump_utils import last from autojump_utils import last
from autojump_utils import sanitize from autojump_utils import sanitize
@ -25,6 +26,12 @@ class StringTestCase(TestCase):
assert_equal(decode(r'blah'), u'blah') assert_equal(decode(r'blah'), u'blah')
assert_equal(decode(r'日本語'), u'日本語') assert_equal(decode(r'日本語'), u'日本語')
def test_has_uppercase(self):
assert_true(has_uppercase('Foo'))
assert_true(has_uppercase('foO'))
assert_false(has_uppercase('foo'))
assert_false(has_uppercase(''))
@mock.patch.object(autojump_utils, 'in_bash', return_value=True) @mock.patch.object(autojump_utils, 'in_bash', return_value=True)
def test_surround_quotes_in_bash(self, _): def test_surround_quotes_in_bash(self, _):
assert_equal(surround_quotes('foo'), '"foo"') assert_equal(surround_quotes('foo'), '"foo"')