Skip to content

Commit dfe3406

Browse files
committed
Skip version-invalid folders in injector files test
1 parent 33ae9c3 commit dfe3406

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

core/src/test/python/wlsdeploy/tool/util/variable_injector_files_test.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ def test_injector_files(self):
3939
elements = injector_path.split('.')
4040
location = LocationContext()
4141
for element in elements[:-1]:
42+
# skip the path if any subfolder is invalid for WLS version
43+
code, _message = self.aliases.is_valid_model_folder_name(location, element)
44+
if code == ValidationCodes.CONTEXT_INVALID:
45+
location = None
46+
break
47+
4248
location.append_location(element)
4349
name_token = self.aliases.get_name_token(location)
4450
if name_token is not None:
@@ -49,11 +55,12 @@ def test_injector_files(self):
4955
self.assertEqual(is_valid, True, "Folder " + str(element) + " in path " + str(injector_path)
5056
+ " in injector file " + str(file_name) + " is not valid")
5157

52-
attribute_name = elements[-1]
53-
code, _message = self.aliases.is_valid_model_attribute_name(location, attribute_name)
54-
is_valid = code in self.VALID_CODES
55-
self.assertEqual(is_valid, True, "Attribute " + str(attribute_name) + " in path " +
56-
str(injector_path) + " in injector file " + str(file_name) + " is not valid")
58+
if location:
59+
attribute_name = elements[-1]
60+
code, _message = self.aliases.is_valid_model_attribute_name(location, attribute_name)
61+
is_valid = code in self.VALID_CODES
62+
self.assertEqual(is_valid, True, "Attribute " + str(attribute_name) + " in path " +
63+
str(injector_path) + " in injector file " + str(file_name) + " is not valid")
5764

5865

5966
if __name__ == '__main__':

0 commit comments

Comments
 (0)