-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c80069b
commit 95bdbed
Showing
13 changed files
with
224 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
tests-old/core/compilation/test_compile_from_source_code.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
tests-old/core/compilation/test_compiler_from_source_file.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,46 @@ | ||
#!/usr/bin/python3 | ||
|
||
from pathlib import Path | ||
import pytest | ||
|
||
import solcx | ||
from solcx.exceptions import ContractsNotFound | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def setup(all_versions): | ||
pass | ||
|
||
|
||
def test_compile_files(contract_path): | ||
solcx.compile_files([contract_path]) | ||
def test_compile_source(foo_source): | ||
output = solcx.compile_source(foo_source, optimize=True) | ||
_compile_assertions(output, "<stdin>:Foo") | ||
|
||
|
||
def test_compile_source_empty(): | ||
with pytest.raises(ContractsNotFound): | ||
solcx.compile_source(" ") | ||
|
||
|
||
def test_compile_files(foo_path): | ||
output = solcx.compile_files([foo_path]) | ||
_compile_assertions(output, f"{foo_path}:Foo") | ||
|
||
|
||
def test_import_remapping(foo_path, bar_path): | ||
path = Path(bar_path).parent.as_posix() | ||
output = solcx.compile_files([bar_path], import_remappings=[f"contracts={path}"]) | ||
assert output | ||
assert f'{bar_path}:Bar' in output | ||
|
||
|
||
def test_compile_files_empty(): | ||
with pytest.raises(ContractsNotFound): | ||
solcx.compile_files([]) | ||
|
||
|
||
def test_compile_source(contract_source): | ||
solcx.compile_source(contract_source) | ||
def _compile_assertions(output, key): | ||
assert output | ||
assert key in output | ||
assert 'bin' in output[key] | ||
assert 'bin-runtime' in output[key] |
Oops, something went wrong.