4 from nmutil
.get_test_path
import get_test_path
5 from bigint_presentation_code
.type_util
import final
10 def __init__(self
, test_case
):
11 # type: (unittest.TestCase) -> None
12 self
.test_case
= test_case
13 self
.base_path
= get_test_path(test_case
, "dumped_graphs")
14 shutil
.rmtree(self
.base_path
, ignore_errors
=True)
15 self
.base_path
.mkdir(parents
=True, exist_ok
=True)
17 def __call__(self
, name
, dot
):
18 # type: (str, str) -> None
19 path
= self
.base_path
/ name
20 dot_path
= path
.with_suffix(".dot")
21 dot_path
.write_text(dot
)