Skip to content

Commit 321f039

Browse files
committed
Add array test with brackets
1 parent 05bfacc commit 321f039

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_api.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class TestApi(utils.TestCase):
99
def setUp(self):
1010
detectlanguage.configuration.api_key = os.environ['DETECTLANGUAGE_API_KEY']
11-
11+
1212
def test_simple_detect(self):
1313
result = detectlanguage.simple_detect("Hello world")
1414
eq_('en', result)
@@ -26,6 +26,10 @@ def test_detect_array(self):
2626
eq_('en', result[0][0]['language'])
2727
eq_('lt', result[1][0]['language'])
2828

29+
def test_detect_array_with_brackets(self):
30+
result = detectlanguage.detect(["[2]Hello world", "Ėjo ežiukas"])
31+
eq_(2, len(result))
32+
2933
def test_user_status(self):
3034
result = detectlanguage.user_status()
3135
eq_('ACTIVE', result['status'])
@@ -45,4 +49,3 @@ class TestApiErrors(utils.TestCase):
4549
def test_invalid_key(self):
4650
detectlanguage.configuration.api_key = 'invalid'
4751
detectlanguage.detect("Hello world")
48-

0 commit comments

Comments
 (0)