more complicated tests

This commit is contained in:
Matthias 2021-12-29 15:43:34 +01:00
parent b1188be019
commit 1eb9b395bc
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -301,6 +301,26 @@ class TestSerialNumberExtraction(TestCase):
e("10, a, 7-70j", 4, 1)
def test_combinations(self):
e = helpers.extract_serial_numbers
sn = e("1 3-5 9+2", 7, 1)
self.assertEqual(len(sn), 7)
self.assertEqual(sn, ['1', 3, 4, 5, 9, 10, 11])
sn = e("1,3-5,9+2", 7, 1)
self.assertEqual(len(sn), 7)
self.assertEqual(sn, ['1', 3, 4, 5, 9, 10, 11])
sn = e("~+2", 3, 14)
self.assertEqual(len(sn), 3)
self.assertEqual(sn, [14, 15, 16])
sn = e("~+", 2, 14)
self.assertEqual(len(sn), 2)
self.assertEqual(sn, [14, 15])
class TestVersionNumber(TestCase):
"""
Unit tests for version number functions