|
4 | 4 | import csv
|
5 | 5 | import json
|
6 | 6 |
|
| 7 | +from causal_testing.testing.causal_test_outcome import NoEffect |
7 | 8 | from tests.test_helpers import create_temp_dir_if_non_existent, remove_temp_dir_if_existent
|
8 | 9 | from causal_testing.json_front.json_class import JsonUtility
|
9 | 10 | from causal_testing.specification.variable import Input, Output, Meta
|
10 | 11 | from causal_testing.specification.scenario import Scenario
|
11 | 12 | from causal_testing.specification.causal_specification import CausalSpecification
|
12 |
| - |
| 13 | +from causal_testing.generation.abstract_causal_test_case import AbstractCausalTestCase |
13 | 14 |
|
14 | 15 | class TestJsonClass(unittest.TestCase):
|
15 | 16 | """Test the CausalTestEngine workflow using observational data.
|
@@ -73,6 +74,23 @@ def test_setup_causal_specification(self):
|
73 | 74 | self.json_class.setup()
|
74 | 75 | self.assertIsInstance(self.json_class.causal_specification, CausalSpecification)
|
75 | 76 |
|
| 77 | + def test_abstract_test_case_generation(self): |
| 78 | + self.json_class.setup() |
| 79 | + effects = {"NoEffect": NoEffect()} |
| 80 | + mutates = None |
| 81 | + expected_effect = dict({"test_input": "NoEffect"}) |
| 82 | + example_test = { |
| 83 | + "name": "test1", |
| 84 | + "mutations": {}, |
| 85 | + "estimator": None, |
| 86 | + "estimate_type": None, |
| 87 | + "effect_modifiers": [], |
| 88 | + "expectedEffect": expected_effect, |
| 89 | + "skip": False, |
| 90 | + } |
| 91 | + abstract_test_case = self.json_class._create_abstract_test_case(example_test, mutates, effects) |
| 92 | + self.assertIsInstance(abstract_test_case, AbstractCausalTestCase) |
| 93 | + |
76 | 94 | def tearDown(self) -> None:
|
77 | 95 | remove_temp_dir_if_existent()
|
78 | 96 |
|
|
0 commit comments