generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
9 changed files
with
72 additions
and
26 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 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
File renamed without changes.
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,13 @@ | ||
import pytest | ||
from ape._cli import cli as ape_cli | ||
from click.testing import CliRunner | ||
|
||
|
||
@pytest.fixture | ||
def runner(): | ||
return CliRunner() | ||
|
||
|
||
@pytest.fixture | ||
def cli(): | ||
return ape_cli |
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,33 @@ | ||
EXPECTED_OUTPUT = """ | ||
arbitrum | ||
├── mainnet | ||
│ ├── alchemy | ||
│ └── geth (default) | ||
├── testnet | ||
│ ├── alchemy (default) | ||
│ └── geth | ||
└── local (default) | ||
└── test (default) | ||
""".strip() | ||
|
||
|
||
def assert_rich_text(actual: str, expected: str): | ||
""" | ||
The output from `rich` causes a bunch of extra spaces to | ||
appear at the end of each line. For easier testing, we remove those here. | ||
""" | ||
actual = f"arbitrum{actual.split('arbitrum')[-1]}" | ||
expected = expected.strip() | ||
lines = actual.split("\n") | ||
new_lines = [] | ||
for line in lines: | ||
if line: | ||
new_lines.append(line.rstrip()) | ||
|
||
actual = "\n".join(new_lines) | ||
assert actual == expected | ||
|
||
|
||
def test_networks(runner, cli): | ||
result = runner.invoke(cli, ["networks", "list"]) | ||
assert_rich_text(result.output, EXPECTED_OUTPUT) |