Skip to content

Commit a0defb2

Browse files
Update broken test case
1 parent 2fcffd9 commit a0defb2

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/json_front_tests/test_json_class.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,28 +240,32 @@ def test_concrete_generate_params(self):
240240
"tests": [
241241
{
242242
"name": "test1",
243-
"treatment_variable": "test_input",
244-
"control_value": 0,
245-
"treatment_value": 1,
243+
"mutations": {"test_input": "Increase"},
246244
"estimator": "LinearRegressionEstimator",
247245
"estimate_type": "ate",
246+
"effect_modifiers": [],
248247
"expected_effect": {"test_output": "NoEffect"},
249248
"sample_size": 5,
250249
"target_ks_score": 0.05,
251250
"skip": False,
252-
253251
}
254252
]
255253
}
256254
self.json_class.test_plan = example_test
257255
effects = {"NoEffect": NoEffect()}
256+
mutates = {
257+
"Increase": lambda x: self.json_class.scenario.treatment_variables[x].z3
258+
> self.json_class.scenario.variables[x].z3
259+
}
258260
estimators = {"LinearRegressionEstimator": LinearRegressionEstimator}
259261

260-
self.json_class.run_json_tests(effects=effects, estimators=estimators, f_flag=False)
262+
self.json_class.run_json_tests(effects=effects, estimators=estimators, f_flag=False, mutates=mutates)
261263

264+
# Test that the final log message prints that failed tests are printed, which is expected behaviour for this
265+
# scenario
262266
with open("temp_out.txt", "r") as reader:
263267
temp_out = reader.readlines()
264-
self.assertIn("FAILED", temp_out[-1])
268+
self.assertIn("failed", temp_out[-1])
265269

266270
def tearDown(self) -> None:
267271
remove_temp_dir_if_existent()

0 commit comments

Comments
 (0)