Browse Source

Rename existing BaseValidator to LegacyBaseValidator

This change is required to introduce refactored validator instead current.

Change-Id: I2972ed8ce23b74b740fe3b6aa49002940677cbcc
Related-Bug: #1534126
Implements: blueprint release-as-a-plugin
Ilya Kutukov 3 years ago
parent
commit
5ec8f1ee88

+ 1
- 1
fuel_plugin_builder/tests/base.py View File

@@ -85,7 +85,7 @@ class BaseTestCase(TestCase):
85 85
 
86 86
 
87 87
 @mock.patch('fuel_plugin_builder.validators.base.utils')
88
-class BaseValidator(BaseTestCase):
88
+class LegacyBaseValidatorTestCase(BaseTestCase):
89 89
 
90 90
     __test__ = False
91 91
     validator_class = None

+ 11
- 7
fuel_plugin_builder/tests/test_base_validator.py View File

@@ -18,13 +18,13 @@ import mock
18 18
 
19 19
 from fuel_plugin_builder import errors
20 20
 from fuel_plugin_builder.tests.base import BaseTestCase
21
-from fuel_plugin_builder.validators import BaseValidator
21
+from fuel_plugin_builder.validators import LegacyBaseValidator
22 22
 
23 23
 
24
-class TestBaseValidator(BaseTestCase):
24
+class LegacyBaseValidatorTestCase(BaseTestCase):
25 25
 
26 26
     def setUp(self):
27
-        class NewValidator(BaseValidator):
27
+        class NewValidator(LegacyBaseValidator):
28 28
 
29 29
             @property
30 30
             def basic_version(self):
@@ -91,7 +91,8 @@ class TestBaseValidator(BaseTestCase):
91 91
                 data, schema, 'file_path', value_path=[0, 'path2'])
92 92
 
93 93
     @mock.patch(
94
-        'fuel_plugin_builder.validators.base.BaseValidator.validate_schema')
94
+        'fuel_plugin_builder.validators.base'
95
+        '.LegacyBaseValidator.validate_schema')
95 96
     def test_validate_file_by_schema_failed(self, utils_mock):
96 97
         utils_mock.parse_yaml.return_value = self.data
97 98
         with self.assertRaisesRegexp(
@@ -102,7 +103,8 @@ class TestBaseValidator(BaseTestCase):
102 103
 
103 104
     @mock.patch('fuel_plugin_builder.validators.base.utils')
104 105
     @mock.patch(
105
-        'fuel_plugin_builder.validators.base.BaseValidator.validate_schema')
106
+        'fuel_plugin_builder.validators.base'
107
+        '.LegacyBaseValidator.validate_schema')
106 108
     def test_validate_file_by_schema(self, validate_mock, utils_mock):
107 109
         utils_mock.parse_yaml.return_value = self.data
108 110
         self.validator.validate_file_by_schema(self.schema, self.plugin_path)
@@ -111,7 +113,8 @@ class TestBaseValidator(BaseTestCase):
111 113
 
112 114
     @mock.patch('fuel_plugin_builder.validators.base.utils')
113 115
     @mock.patch(
114
-        'fuel_plugin_builder.validators.base.BaseValidator.validate_schema')
116
+        'fuel_plugin_builder.validators.base'
117
+        '.LegacyBaseValidator.validate_schema')
115 118
     def test_validate_file_by_schema_empty_file_passes(
116 119
             self, validate_mock, utils_mock):
117 120
         utils_mock.parse_yaml.return_value = None
@@ -123,7 +126,8 @@ class TestBaseValidator(BaseTestCase):
123 126
 
124 127
     @mock.patch('fuel_plugin_builder.validators.base.utils')
125 128
     @mock.patch(
126
-        'fuel_plugin_builder.validators.base.BaseValidator.validate_schema')
129
+        'fuel_plugin_builder.validators.base'
130
+        '.LegacyBaseValidator.validate_schema')
127 131
     def test_validate_file_by_schema_empty_file_fails(
128 132
             self, validate_mock, utils_mock):
129 133
         utils_mock.parse_yaml.return_value = None

+ 2
- 2
fuel_plugin_builder/tests/test_validator_v1.py View File

@@ -17,12 +17,12 @@
17 17
 import mock
18 18
 
19 19
 from fuel_plugin_builder import errors
20
-from fuel_plugin_builder.tests.base import BaseValidator
20
+from fuel_plugin_builder.tests.base import LegacyBaseValidatorTestCase
21 21
 from fuel_plugin_builder.validators.schemas.v1 import SchemaV1
22 22
 from fuel_plugin_builder.validators.validator_v1 import ValidatorV1
23 23
 
24 24
 
25
-class TestValidatorV1(BaseValidator):
25
+class TestValidatorV1(LegacyBaseValidatorTestCase):
26 26
 
27 27
     __test__ = True
28 28
     validator_class = ValidatorV1

+ 2
- 2
fuel_plugin_builder/tests/test_validator_v2.py View File

@@ -17,12 +17,12 @@
17 17
 import mock
18 18
 
19 19
 from fuel_plugin_builder import errors
20
-from fuel_plugin_builder.tests.base import BaseValidator
20
+from fuel_plugin_builder.tests.base import LegacyBaseValidatorTestCase
21 21
 from fuel_plugin_builder.validators.schemas.v2 import SchemaV2
22 22
 from fuel_plugin_builder.validators.validator_v2 import ValidatorV2
23 23
 
24 24
 
25
-class TestValidatorV2(BaseValidator):
25
+class TestValidatorV2(LegacyBaseValidatorTestCase):
26 26
 
27 27
     __test__ = True
28 28
     validator_class = ValidatorV2

+ 2
- 2
fuel_plugin_builder/tests/test_validator_v3.py View File

@@ -17,12 +17,12 @@
17 17
 import mock
18 18
 
19 19
 from fuel_plugin_builder import errors
20
-from fuel_plugin_builder.tests.base import BaseValidator
20
+from fuel_plugin_builder.tests.base import LegacyBaseValidatorTestCase
21 21
 from fuel_plugin_builder.validators.schemas import SchemaV3
22 22
 from fuel_plugin_builder.validators.validator_v3 import ValidatorV3
23 23
 
24 24
 
25
-class TestValidatorV3(BaseValidator):
25
+class TestValidatorV3(LegacyBaseValidatorTestCase):
26 26
 
27 27
     __test__ = True
28 28
     validator_class = ValidatorV3

+ 1
- 1
fuel_plugin_builder/validators/__init__.py View File

@@ -19,4 +19,4 @@ from fuel_plugin_builder.validators.validator_v1 import ValidatorV1
19 19
 from fuel_plugin_builder.validators.validator_v2 import ValidatorV2
20 20
 from fuel_plugin_builder.validators.validator_v3 import ValidatorV3
21 21
 from fuel_plugin_builder.validators.validator_v4 import ValidatorV4
22
-from fuel_plugin_builder.validators.base import BaseValidator
22
+from fuel_plugin_builder.validators.base import LegacyBaseValidator

+ 1
- 1
fuel_plugin_builder/validators/base.py View File

@@ -29,7 +29,7 @@ logger = logging.getLogger(__name__)
29 29
 
30 30
 
31 31
 @six.add_metaclass(abc.ABCMeta)
32
-class BaseValidator(object):
32
+class LegacyBaseValidator(object):
33 33
 
34 34
     @abc.abstractproperty
35 35
     def basic_version(self):

+ 2
- 2
fuel_plugin_builder/validators/validator_v1.py View File

@@ -18,14 +18,14 @@ import logging
18 18
 from os.path import join as join_path
19 19
 
20 20
 from fuel_plugin_builder import utils
21
-from fuel_plugin_builder.validators.base import BaseValidator
21
+from fuel_plugin_builder.validators.base import LegacyBaseValidator
22 22
 from fuel_plugin_builder.validators.schemas import SchemaV1
23 23
 
24 24
 
25 25
 logger = logging.getLogger(__name__)
26 26
 
27 27
 
28
-class ValidatorV1(BaseValidator):
28
+class ValidatorV1(LegacyBaseValidator):
29 29
 
30 30
     schema = SchemaV1()
31 31
 

+ 2
- 2
fuel_plugin_builder/validators/validator_v2.py View File

@@ -18,14 +18,14 @@ import logging
18 18
 from os.path import join as join_path
19 19
 
20 20
 from fuel_plugin_builder import utils
21
-from fuel_plugin_builder.validators.base import BaseValidator
21
+from fuel_plugin_builder.validators.base import LegacyBaseValidator
22 22
 from fuel_plugin_builder.validators.schemas import SchemaV2
23 23
 
24 24
 
25 25
 logger = logging.getLogger(__name__)
26 26
 
27 27
 
28
-class ValidatorV2(BaseValidator):
28
+class ValidatorV2(LegacyBaseValidator):
29 29
 
30 30
     schema = SchemaV2()
31 31
 

Loading…
Cancel
Save