@@ -39,6 +39,12 @@ def test_injector_files(self):
39
39
elements = injector_path .split ('.' )
40
40
location = LocationContext ()
41
41
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
+
42
48
location .append_location (element )
43
49
name_token = self .aliases .get_name_token (location )
44
50
if name_token is not None :
@@ -49,11 +55,12 @@ def test_injector_files(self):
49
55
self .assertEqual (is_valid , True , "Folder " + str (element ) + " in path " + str (injector_path )
50
56
+ " in injector file " + str (file_name ) + " is not valid" )
51
57
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" )
57
64
58
65
59
66
if __name__ == '__main__' :
0 commit comments