From 7532baae57543cdc4627998728fe6ae0be7a3056 Mon Sep 17 00:00:00 2001 From: webthethird Date: Mon, 20 Mar 2023 10:24:37 -0500 Subject: [PATCH] Finish testing interface generation --- tests/test_code_generation.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_code_generation.py b/tests/test_code_generation.py index 9733f7c90..35db30a44 100644 --- a/tests/test_code_generation.py +++ b/tests/test_code_generation.py @@ -19,7 +19,12 @@ def test_interface_generation() -> None: sl = Slither(os.path.join(CODE_TEST_ROOT, "CodeGeneration.sol")) - with open("actual_generated_code.sol", "w", encoding="utf-8") as file: - file.write(generate_interface(sl.get_contract_from_name("TestContract")[0])) + actual = generate_interface(sl.get_contract_from_name("TestContract")[0]) + expected_path = os.path.join(CODE_TEST_ROOT, "TEST_generated_code.sol") + + with open(expected_path, "r", encoding="utf-8") as file: + expected = file.read() + + assert actual == expected