-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds a line of coverage to test. * Add coverage for csvs module. * Add coverage to check_network. * Add coverage to predictions and traction info. * Adds coverage to predictoor stats. * Adds full coverage to arg cli classes. * Adds cli arguments coverage and fix a wrong parameter in cli arguments. * Adds coverage to cli module and timeframe. * Some reformats and coverage in contract module. * Adds coverage and simplifications to contracts, except token. * Add some coverage to tokens to complete contract coverage work.
- Loading branch information
Showing
38 changed files
with
719 additions
and
353 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
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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import pytest | ||
|
||
from pdr_backend.cli.cli_arguments import ( | ||
CustomArgParser, | ||
defined_parsers, | ||
do_help_long, | ||
get_arg_parser, | ||
print_args, | ||
) | ||
|
||
|
||
def test_arg_parser(): | ||
for arg in defined_parsers: | ||
parser = get_arg_parser(arg) | ||
assert isinstance(parser, CustomArgParser) | ||
|
||
with pytest.raises(ValueError): | ||
get_arg_parser("xyz") | ||
|
||
|
||
def test_do_help_long(capfd): | ||
with pytest.raises(SystemExit): | ||
do_help_long() | ||
|
||
out, _ = capfd.readouterr() | ||
assert "Predictoor tool" in out | ||
assert "Main tools:" in out | ||
|
||
|
||
def test_print_args(capfd): | ||
SimArgParser = defined_parsers["do_sim"] | ||
parser = SimArgParser | ||
args = ["sim", "ppss.yaml"] | ||
parsed_args = parser.parse_args(args) | ||
|
||
print_args(parsed_args) | ||
|
||
out, _ = capfd.readouterr() | ||
assert "dftool sim: Begin" in out | ||
assert "Arguments:" in out | ||
assert "PPSS_FILE=ppss.yaml" in out |
Oops, something went wrong.