1
+ import pytest
2
+
1
3
from regression .LVSA .lvsa_driver import LvsaDriver , EvsType
2
4
3
5
folder_name = 'TestEVS'
@@ -70,8 +72,7 @@ def test_read_from_field_from_supertype(tmpdir):
70
72
71
73
value_set_expectation .check_number_of_values (2 )
72
74
value_set_expectation .check_contains_per_field_evs (access_path = ['.left' ])
73
- value_set_expectation .
check_contains_precise_evs (
label_suffix = 'b' ,
access_path = [
'[email protected] $A.node' ,
74
- '.left' ])
75
+ value_set_expectation .check_contains_precise_evs (label_suffix = 'b' , access_path = ['.node' , '.left' ])
75
76
76
77
77
78
def test_write_to_field_from_supertype (tmpdir ):
@@ -83,7 +84,8 @@ def test_write_to_field_from_supertype(tmpdir):
83
84
value_set_expectation .check_number_of_values (3 )
84
85
value_set_expectation .check_contains_dynamic_object ()
85
86
value_set_expectation .check_contains_per_field_evs (access_path = ['.left' ])
86
- value_set_expectation .
check_contains_precise_evs (
access_path = [
'[email protected] $A.node' ,
'.left' ])
87
+ value_set_expectation .check_contains_precise_evs (access_path = ['.node' , '.left' ],
88
+ decl_on_types = ['LVSA.TestEVS.Test$A' , 'LVSA.TestEVS.Test$Node' ])
87
89
88
90
89
91
def test_write_to_field_of_B_through_A (tmpdir ):
@@ -95,7 +97,114 @@ def test_write_to_field_of_B_through_A(tmpdir):
95
97
value_set_expectation .check_number_of_values (3 )
96
98
value_set_expectation .check_contains_root_object_evs (label_suffix = 'node_parameter' )
97
99
value_set_expectation .check_contains_per_field_evs (access_path = ['.node' ])
98
- value_set_expectation .
check_contains_precise_evs (
label_suffix = 'b' ,
access_path = [
'[email protected] $A.node' ])
100
+ value_set_expectation .check_contains_precise_evs (label_suffix = 'b' , access_path = ['.node' ],
101
+ decl_on_types = ['LVSA.TestEVS.Test$A' ])
102
+
103
+
104
+ def test_apply_call_overridden_method_on_A_with_A (tmpdir ):
105
+ lvsa_driver = LvsaDriver (tmpdir , folder_name ).with_test_function ('apply_call_overridden_method_on_A_with_A' )
106
+ lvsa_expectation = lvsa_driver .run ()
107
+
108
+ value_set_expectation = lvsa_expectation .get_value_set_for_public_static ('static_node' )
109
+
110
+ value_set_expectation .check_number_of_values (2 )
111
+ value_set_expectation .check_contains_dynamic_object ()
112
+ value_set_expectation .check_contains_root_object_evs (label_suffix = 'static_node' )
113
+
114
+
115
+ def test_apply_call_overridden_method_on_A_with_B (tmpdir ):
116
+ lvsa_driver = LvsaDriver (tmpdir , folder_name ).with_test_function ('apply_call_overridden_method_on_A_with_B' )
117
+ lvsa_expectation = lvsa_driver .run ()
118
+
119
+ value_set_expectation = lvsa_expectation .get_value_set_for_public_static ('static_node' )
120
+
121
+ # Only test for what's important as CSVSA-driven-lazy-loading changes the results
122
+ value_set_expectation .check_contains_null_object ()
123
+ value_set_expectation .check_contains_root_object_evs (label_suffix = 'static_node' )
124
+
125
+
126
+ def test_apply_call_overridden_method_on_A_with_C (tmpdir ):
127
+ lvsa_driver = LvsaDriver (tmpdir , folder_name ).with_test_function ('apply_call_overridden_method_on_A_with_C' )
128
+ lvsa_expectation = lvsa_driver .run ()
129
+
130
+ value_set_expectation = lvsa_expectation .get_value_set_for_public_static ('static_node' )
131
+
132
+ # Only test for what's important as CSVSA-driven-lazy-loading changes the results
133
+ value_set_expectation .check_contains_null_object ()
134
+ value_set_expectation .check_contains_root_object_evs (label_suffix = 'static_node' )
135
+
136
+
137
+ def test_call_overridden_method_on_B (tmpdir ):
138
+ lvsa_driver = LvsaDriver (tmpdir , folder_name ).with_test_function ('call_overridden_method_on_B' )
139
+ lvsa_expectation = lvsa_driver .run ()
140
+
141
+ value_set_expectation = lvsa_expectation .get_value_set_for_public_static ('static_node' )
142
+
143
+ value_set_expectation .check_number_of_values (2 )
144
+ value_set_expectation .check_contains_dynamic_object ()
145
+ value_set_expectation .check_contains_per_field_evs (access_path = ['.extra_node' ])
146
+
147
+
148
+ def test_call_overridden_method_on_C (tmpdir ):
149
+ lvsa_driver = LvsaDriver (tmpdir , folder_name ).with_test_function ('call_overridden_method_on_C' )
150
+ lvsa_expectation = lvsa_driver .run ()
151
+
152
+ value_set_expectation = lvsa_expectation .get_value_set_for_public_static ('static_node' )
153
+
154
+ value_set_expectation .check_number_of_values (2 )
155
+ value_set_expectation .check_contains_dynamic_object ()
156
+ value_set_expectation .check_contains_per_field_evs (access_path = ['.extra_node' ])
157
+
158
+
159
+ def test_call_overridden_method_on_C_upcast_to_A (tmpdir ):
160
+ lvsa_driver = LvsaDriver (tmpdir , folder_name ).with_test_function ('call_overridden_method_on_C_upcast_to_A' )
161
+ lvsa_expectation = lvsa_driver .run ()
162
+
163
+ value_set_expectation = lvsa_expectation .get_value_set_for_public_static ('static_node' )
164
+
165
+ # Only test for what's important as CSVSA-driven-lazy-loading changes the results
166
+ value_set_expectation .check_contains_dynamic_object ()
167
+ value_set_expectation .check_contains_per_field_evs (access_path = ['.extra_node' ])
168
+
169
+
170
+ def test_call_function_with_B_parameter_with_C_argument (tmpdir ):
171
+ lvsa_driver = LvsaDriver (tmpdir , folder_name ).with_test_function ('call_function_with_B_parameter_with_C_argument' )
172
+ lvsa_expectation = lvsa_driver .run ()
173
+
174
+ value_set_expectation = lvsa_expectation .get_value_set_for_public_static ('static_object' )
175
+
176
+ value_set_expectation .check_number_of_values (3 )
177
+ value_set_expectation .check_contains_root_object_evs (label_suffix = 'static_object' )
178
+ value_set_expectation .check_contains_precise_evs (label_suffix = 'c' , access_path = ['.extra_object' ])
179
+ value_set_expectation .check_contains_per_field_evs (access_path = ['.extra_object' ], is_initializer = True )
180
+
181
+
182
+ def test_call_function_with_B_parameter_with_A_argument_cast_to_C (tmpdir ):
183
+ lvsa_driver = LvsaDriver (tmpdir , folder_name ).with_test_function (
184
+ 'call_function_with_B_parameter_with_A_argument_cast_to_C' )
185
+ lvsa_expectation = lvsa_driver .run ()
186
+
187
+ value_set_expectation = lvsa_expectation .get_value_set_for_public_static ('static_object' )
188
+
189
+ value_set_expectation .check_number_of_values (3 )
190
+ value_set_expectation .check_contains_root_object_evs (label_suffix = 'static_object' )
191
+ value_set_expectation .check_contains_per_field_evs (access_path = ['.extra_object' ],
192
+ decl_on_types = ['LVSA.TestEVS.Test$C' ], is_initializer = True )
193
+ value_set_expectation .check_contains_precise_evs (access_path = ['.extra_object' ],
194
+ decl_on_types = ['LVSA.TestEVS.Test$C' ])
195
+
196
+
197
+ def test_apply_call_function_with_B_parameter_with_A_argument_cast_to_C_with_C (tmpdir ):
198
+ lvsa_driver = LvsaDriver (tmpdir , folder_name ).with_test_function (
199
+ 'apply_call_function_with_B_parameter_with_A_argument_cast_to_C_with_C' )
200
+ lvsa_expectation = lvsa_driver .run ()
201
+
202
+ value_set_expectation = lvsa_expectation .get_value_set_for_public_static ('static_object' )
203
+
204
+ value_set_expectation .check_number_of_values (3 )
205
+ value_set_expectation .check_contains_root_object_evs (label_suffix = 'static_object' )
206
+ value_set_expectation .check_contains_dynamic_object ()
207
+ value_set_expectation .check_contains_per_field_evs (access_path = ['.extra_object' ], is_initializer = True )
99
208
100
209
101
210
def test_read_from_array (tmpdir ):
@@ -152,7 +261,7 @@ def test_read_from_array_field(tmpdir):
152
261
153
262
value_set_expectation .check_number_of_values (2 )
154
263
value_set_expectation .check_contains_per_field_evs (access_path = ['[]' ])
155
- value_set_expectation .check_contains_precise_evs (access_path = ['.object_array' ,'.data' , '[]' ])
264
+ value_set_expectation .check_contains_precise_evs (access_path = ['.object_array' , '.data' , '[]' ])
156
265
157
266
158
267
def test_write_to_array_field (tmpdir ):
@@ -164,7 +273,7 @@ def test_write_to_array_field(tmpdir):
164
273
value_set_expectation .check_number_of_values (3 )
165
274
value_set_expectation .check_contains_dynamic_object ()
166
275
value_set_expectation .check_contains_per_field_evs (access_path = ['[]' ])
167
- value_set_expectation .check_contains_precise_evs (access_path = ['.object_array' ,'.data' , '[]' ])
276
+ value_set_expectation .check_contains_precise_evs (access_path = ['.object_array' , '.data' , '[]' ])
168
277
169
278
170
279
def test_apply_function_which_sets_static_variable (tmpdir ):
0 commit comments