Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy authored and DanielSchiavini committed Aug 15, 2024
1 parent e574dce commit e42232a
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/test_get_compiler_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import pytest

from boa_zksync.compiler_utils import get_compiler_output


def test_get_compiler_output():

output_dict = {
"blabla": 123,
"zk_version": 456,
"version": 789,
}

get_compiler_output(output_dict) == 123


def test_get_compiler_output_revert_too_many_keys():

output_dict = {
"blabla": 123,
"zk_version": 456,
"version": 789,
"new_compiler_output_key": 101112,
}

with pytest.raises(ValueError, match="Expected exactly one contract key, found 2"):
get_compiler_output(output_dict)


def test_get_compiler_output_revert_unexpected_key():

output_dict = {
"blabla": 123,
"zk_versions": 456,
"version": 789,
}

with pytest.raises(ValueError, match="Expected exactly one contract key, found 2"):
get_compiler_output(output_dict)

0 comments on commit e42232a

Please sign in to comment.