Browse Source

Changed the used method for the check_data tests (using now the public one instead of the protected)

Roland Haroutiounian 8 years ago
parent
commit
e9174bb847

+ 2
- 2
tests/datahandlers/test_boolean.py View File

@@ -10,12 +10,12 @@ class BooleanTestCase(unittest.TestCase):
10 10
 
11 11
         # correct values
12 12
         for test_value in [True, False]:
13
-            value, error = test_boolean._check_data_value(test_value)
13
+            value, error = test_boolean.check_data_value(test_value)
14 14
             self.assertIsNone(error)
15 15
 
16 16
         # incorrect values
17 17
         for test_value in ['ok', 'True', 'False']:
18
-            value, error = test_boolean._check_data_value(test_value)
18
+            value, error = test_boolean.check_data_value(test_value)
19 19
             self.assertIsNotNone(error)
20 20
 
21 21
     def test_can_override(self):

+ 2
- 2
tests/datahandlers/test_integer.py View File

@@ -10,12 +10,12 @@ class IntegerTestCase(unittest.TestCase):
10 10
 
11 11
         # Incorrect values
12 12
         for test_bad_value in ['ok','ceci est un test', '15.2', 15.2]:
13
-            _, error = test_int._check_data_value(test_bad_value)
13
+            _, error = test_int.check_data_value(test_bad_value)
14 14
             self.assertIsNotNone(error)
15 15
 
16 16
         # Correct values
17 17
         for test_correct_value in [10, '15', '15.0']:
18
-            _, error = test_int._check_data_value(test_correct_value)
18
+            _, error = test_int.check_data_value(test_correct_value)
19 19
             self.assertIsNone(error)
20 20
 
21 21
     def test_can_override(self):

+ 3
- 3
tests/datahandlers/test_regex.py View File

@@ -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)

+ 1
- 1
tests/datahandlers/test_text.py View File

@@ -11,5 +11,5 @@ class TextTestCase(unittest.TestCase):
11 11
         Text
12 12
         """
13 13
         test_text = Text()
14
-        _, error = test_text._check_data_value(test_value)
14
+        _, error = test_text.check_data_value(test_value)
15 15
         self.assertIsNone(error)

+ 3
- 3
tests/datahandlers/test_varchar.py View File

@@ -8,13 +8,13 @@ class VarcharTestCase(unittest.TestCase):
8 8
     def test_check_data_value(self):
9 9
         test_varchar = Varchar(max_length=10)
10 10
 
11
-        _, error = test_varchar._check_data_value("c" * 10)
11
+        _, error = test_varchar.check_data_value("c" * 10)
12 12
         self.assertIsNone(error)
13 13
 
14
-        _, error = test_varchar._check_data_value("c" * 9)
14
+        _, error = test_varchar.check_data_value("c" * 9)
15 15
         self.assertIsNone(error)
16 16
 
17
-        _, error = test_varchar._check_data_value("c" * 11)
17
+        _, error = test_varchar.check_data_value("c" * 11)
18 18
         self.assertIsNotNone(error)
19 19
         self.assertIsInstance(error, ValueError)
20 20
 

Loading…
Cancel
Save