Add additional tests.

This commit is contained in:
Roberto Rosario
2017-01-18 01:59:00 -04:00
parent 83149a09e7
commit bb8b606c92
5 changed files with 181 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
from __future__ import unicode_literals
from common.tests import BaseTestCase
from ..utils import parse_range
class DocumentUtilsTestCase(BaseTestCase):
def test_parse_range(self):
self.assertEqual(
parse_range('1'), [1]
)
self.assertEqual(
parse_range('1-5'), [1, 2, 3, 4 ,5]
)
self.assertEqual(
parse_range('2,4,6'), [2, 4, 6]
)
self.assertEqual(
parse_range('2,4,6-8'), [2, 4, 6, 7, 8]
)