Skip to content

Commit 2fcffd9

Browse files
Add unittest
1 parent 62ccef3 commit 2fcffd9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/json_front_tests/test_json_class.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,33 @@ def test_run_concrete_json_testcase(self):
235235
with open("temp_out.txt", "r") as reader:
236236
temp_out = reader.readlines()
237237
self.assertIn("FAILED", temp_out[-1])
238+
def test_concrete_generate_params(self):
239+
example_test = {
240+
"tests": [
241+
{
242+
"name": "test1",
243+
"treatment_variable": "test_input",
244+
"control_value": 0,
245+
"treatment_value": 1,
246+
"estimator": "LinearRegressionEstimator",
247+
"estimate_type": "ate",
248+
"expected_effect": {"test_output": "NoEffect"},
249+
"sample_size": 5,
250+
"target_ks_score": 0.05,
251+
"skip": False,
252+
253+
}
254+
]
255+
}
256+
self.json_class.test_plan = example_test
257+
effects = {"NoEffect": NoEffect()}
258+
estimators = {"LinearRegressionEstimator": LinearRegressionEstimator}
259+
260+
self.json_class.run_json_tests(effects=effects, estimators=estimators, f_flag=False)
261+
262+
with open("temp_out.txt", "r") as reader:
263+
temp_out = reader.readlines()
264+
self.assertIn("FAILED", temp_out[-1])
238265

239266
def tearDown(self) -> None:
240267
remove_temp_dir_if_existent()

0 commit comments

Comments
 (0)