|
@@ -9,7 +9,7 @@ class RegexTestCase(unittest.TestCase):
|
9
|
9
|
test_value = '126.205.255.12'
|
10
|
10
|
test_regex = Regex('^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$',
|
11
|
11
|
max_length=100)
|
12
|
|
- value, error = test_regex._check_data_value(test_value)
|
|
12
|
+ value, error = test_regex.check_data_value(test_value)
|
13
|
13
|
self.assertIsNone(error)
|
14
|
14
|
self.assertEqual(value, test_value)
|
15
|
15
|
|
|
@@ -17,7 +17,7 @@ class RegexTestCase(unittest.TestCase):
|
17
|
17
|
test_regex = Regex('^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$',
|
18
|
18
|
max_length=15)
|
19
|
19
|
for test_value in ['800.9.10.5', 'test_string_value', '999.999.999.999']:
|
20
|
|
- value, error = test_regex._check_data_value(test_value)
|
|
20
|
+ value, error = test_regex.check_data_value(test_value)
|
21
|
21
|
self.assertEqual(value, '')
|
22
|
22
|
self.assertIsNotNone(error)
|
23
|
23
|
|
|
@@ -25,7 +25,7 @@ class RegexTestCase(unittest.TestCase):
|
25
|
25
|
test_max_length = 15
|
26
|
26
|
test_regex = Regex('[a-z]+8?', max_length=15)
|
27
|
27
|
for test_value in ['cccccc8', 'ccccccccccccccccccccccccccccccccc8']:
|
28
|
|
- value, error = test_regex._check_data_value(test_value)
|
|
28
|
+ value, error = test_regex.check_data_value(test_value)
|
29
|
29
|
if len(test_value)>test_max_length:
|
30
|
30
|
self.assertEqual(value, '')
|
31
|
31
|
self.assertIsNotNone(error)
|