Skip to content

Commit 006d4ff

Browse files
committed
Added test for no datatypes
1 parent f1e5a0f commit 006d4ff

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/specification_tests/test_generate_causal_tests.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def sort_test_dict(test: dict):
1313
return test["name"]
1414

1515

16-
class TestMetamorphicRelation(unittest.TestCase):
16+
class TestGenerateCausalTestCases(unittest.TestCase):
1717
def setUp(self) -> None:
1818
self.temp_dir_path = tempfile.mkdtemp()
1919
self.dag_dot_path = os.path.join(self.temp_dir_path, "dag.dot")
@@ -139,6 +139,12 @@ def test_all_metamorphic_relations_implied_by_dag_parallel(self):
139139
sorted(map(lambda t: t.to_dict(), dag.generate_causal_tests(threads=2)), key=sort_test_dict),
140140
)
141141

142+
def test_all_metamorphic_relations_implied_by_dag_no_datatype(self):
143+
causal_dag = CausalDAG(self.dag_dot_path)
144+
with self.assertRaises(ValueError) as e:
145+
causal_dag.generate_causal_tests()
146+
self.assertEqual(e.exception, "No datatype specified for .")
147+
142148
def test_all_metamorphic_relations_implied_by_dag_ignore_cycles(self):
143149
dcg = CausalDAG(self.dcg_dot_path, ignore_cycles=True, datatypes={v: float for v in {"a", "b", "c", "d"}})
144150

0 commit comments

Comments
 (0)