Skip to content

Commit

Permalink
add env var test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed Feb 19, 2020
1 parent ab8b8d4 commit 7eeb89e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,30 @@ def test_install_osx():

def test_progress_bar(nosolc):
solcx.install_solc('0.6.0', show_progress=True)


def test_environment_var_path(monkeypatch, tmp_path):
install_folder = solcx.get_solc_folder()
monkeypatch.setenv('SOLCX_BINARY_PATH', tmp_path.as_posix())
assert solcx.get_solc_folder() != install_folder

monkeypatch.undo()
assert solcx.get_solc_folder() == install_folder


def test_environment_var_versions(monkeypatch, tmp_path):
versions = solcx.get_installed_solc_versions()
monkeypatch.setenv('SOLCX_BINARY_PATH', tmp_path.as_posix())
assert solcx.get_installed_solc_versions() != versions

monkeypatch.undo()
assert solcx.get_installed_solc_versions() == versions


def test_environment_var_install(monkeypatch, tmp_path):
assert not tmp_path.joinpath('solc-v0.6.0').exists()

monkeypatch.setenv('SOLCX_BINARY_PATH', tmp_path.as_posix())

solcx.install_solc('0.6.0')
assert tmp_path.joinpath('solc-v0.6.0').exists()

0 comments on commit 7eeb89e

Please sign in to comment.