-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove alias arg instead of opt
- Loading branch information
Showing
10 changed files
with
59 additions
and
43 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import shutil | ||
|
||
import pytest | ||
from click.testing import CliRunner | ||
|
||
from ape_safe._cli import cli as CLI | ||
|
||
|
||
@pytest.fixture | ||
def runner(): | ||
return CliRunner() | ||
|
||
|
||
@pytest.fixture | ||
def cli(): | ||
return CLI | ||
|
||
|
||
@pytest.fixture | ||
def no_safes(data_folder): | ||
shutil.rmtree(data_folder, ignore_errors=True) | ||
|
||
|
||
@pytest.fixture | ||
def one_safe(data_folder, safes, safe): | ||
shutil.rmtree(data_folder) | ||
safes.save_account(safe.alias, safe.address) | ||
return safes.load_account(safe.alias) |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def test_help(runner, cli): | ||
result = runner.invoke(cli, ["--help"], catch_exceptions=False) | ||
assert result.exit_code == 0, result.output |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
def test_list_no_safes(runner, cli, no_safes): | ||
result = runner.invoke(cli, ["list"], catch_exceptions=False) | ||
assert result.exit_code == 0, result.output | ||
assert "No Safes found" in result.output | ||
|
||
|
||
def test_list_one_safe(runner, cli, one_safe): | ||
result = runner.invoke(cli, ["list"], catch_exceptions=False) | ||
assert result.exit_code == 0, result.output | ||
assert "Found 1 Safe" in result.output | ||
assert "0x5FbDB2315678afecb367f032d93F642f64180aa3" in result.output | ||
|
||
|
||
def test_add_safe(runner, cli, no_safes, safe): | ||
result = runner.invoke( | ||
cli, ["add", safe.address, safe.alias], catch_exceptions=False, input="y\n" | ||
) | ||
assert result.exit_code == 0, result.output | ||
assert "SUCCESS" in result.output, result.output | ||
|
||
|
||
def test_remove_safe(runner, cli, one_safe, safe): | ||
result = runner.invoke(cli, ["remove", safe.alias], catch_exceptions=False, input="y\n") | ||
assert result.exit_code == 0, result.output | ||
assert "SUCCESS" in result.output, result.output |
This file was deleted.
Oops, something went wrong.