Skip to content

Commit

Permalink
Finish testing interface generation
Browse files Browse the repository at this point in the history
  • Loading branch information
webthethird committed Mar 20, 2023
1 parent b78fa7f commit 7532baa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_code_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


0 comments on commit 7532baa

Please sign in to comment.