Skip to content

Commit 0888672

Browse files
Add new test files
1 parent 1da7ebb commit 0888672

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

tests/json_front_tests/test_json_class.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_f_flag(self):
9999
effects = {"NoEffect": NoEffect()}
100100
mutates = {
101101
"Increase": lambda x: self.json_class.scenario.treatment_variables[x].z3
102-
> self.json_class.scenario.variables[x].z3
102+
> self.json_class.scenario.variables[x].z3
103103
}
104104
estimators = {"LinearRegressionEstimator": LinearRegressionEstimator}
105105
with self.assertRaises(StatisticsError):
@@ -149,7 +149,7 @@ def test_run_json_tests_from_json(self):
149149
effects = {"NoEffect": NoEffect()}
150150
mutates = {
151151
"Increase": lambda x: self.json_class.scenario.treatment_variables[x].z3
152-
> self.json_class.scenario.variables[x].z3
152+
> self.json_class.scenario.variables[x].z3
153153
}
154154
estimators = {"LinearRegressionEstimator": LinearRegressionEstimator}
155155

@@ -176,7 +176,7 @@ def test_generate_tests_from_json_no_dist(self):
176176
effects = {"NoEffect": NoEffect()}
177177
mutates = {
178178
"Increase": lambda x: self.json_class.scenario.treatment_variables[x].z3
179-
> self.json_class.scenario.variables[x].z3
179+
> self.json_class.scenario.variables[x].z3
180180
}
181181
estimators = {"LinearRegressionEstimator": LinearRegressionEstimator}
182182

@@ -206,7 +206,7 @@ def test_formula_in_json_test(self):
206206
effects = {"Positive": Positive()}
207207
mutates = {
208208
"Increase": lambda x: self.json_class.scenario.treatment_variables[x].z3
209-
> self.json_class.scenario.variables[x].z3
209+
> self.json_class.scenario.variables[x].z3
210210
}
211211
estimators = {"LinearRegressionEstimator": LinearRegressionEstimator}
212212

@@ -259,7 +259,7 @@ def test_concrete_generate_params(self):
259259
effects = {"NoEffect": NoEffect()}
260260
mutates = {
261261
"Increase": lambda x: self.json_class.scenario.treatment_variables[x].z3
262-
> self.json_class.scenario.variables[x].z3
262+
> self.json_class.scenario.variables[x].z3
263263
}
264264
estimators = {"LinearRegressionEstimator": LinearRegressionEstimator}
265265

@@ -294,16 +294,15 @@ def test_estimator_formula_type_check(self):
294294
]
295295
}
296296
self.json_class.test_plan = example_test
297-
297+
effects = {"Positive": Positive()}
298+
mutates = {
299+
"Increase": lambda x: self.json_class.scenario.treatment_variables[x].z3
300+
> self.json_class.scenario.variables[x].z3
301+
}
302+
estimators = {"CausalForestEstimator": CausalForestEstimator}
298303
with self.assertRaises(TypeError):
299304
self.json_class.run_json_tests(effects=effects, mutates=mutates, estimators=estimators, f_flag=False)
300305

301-
effects = {"Positive": Positive()}
302-
mutates = {
303-
"Increase": lambda x: self.json_class.scenario.treatment_variables[x].z3
304-
> self.json_class.scenario.variables[x].z3
305-
}
306-
estimators = {"CausalForestEstimator": CausalForestEstimator}
307306

308307
def test_constructive_back_door_not_met(self):
309308
example_test = {
@@ -334,7 +333,6 @@ def test_constructive_back_door_not_met(self):
334333
test_data_dir_path = Path("tests/resources/data")
335334
dag_path = str(test_data_dir_path / "dag_not_descendent.dot")
336335
data_path = [str(test_data_dir_path / "not_descendent.csv")]
337-
338336
input_dict_list = [
339337
{"name": "X", "datatype": float},
340338
{"name": "Z", "datatype": float},
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
digraph G {X -> Y; Z -> X; Z -> Y}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
X,Y,Z
2+
0,0,0

0 commit comments

Comments
 (0)