Skip to content

Commit

Permalink
refactor: Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
roda82 committed Nov 22, 2023
1 parent 5501b9f commit e60f2f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions powerapi/cli/common_cli_parsing_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
POWERAPI_PRE_PROCESSOR_ENVIRONMENT_VARIABLE_PREFIX = POWERAPI_ENVIRONMENT_VARIABLE_PREFIX + 'PRE_PROCESSOR_'
POWERAPI_POST_PROCESSOR_ENVIRONMENT_VARIABLE_PREFIX = POWERAPI_ENVIRONMENT_VARIABLE_PREFIX + 'POST_PROCESSOR'

TAGS_ARGUMENT_HELP_TEXT = 'specify report tags'

Check warning on line 45 in powerapi/cli/common_cli_parsing_manager.py

View check run for this annotation

Codecov / codecov/patch

powerapi/cli/common_cli_parsing_manager.py#L45

Added line #L45 was not covered by tests


def extract_file_names(arg, val, args, acc):
"""
Expand Down Expand Up @@ -253,7 +255,7 @@ def __init__(self):
)

subparser_prometheus_output = SubgroupConfigParsingManager("prometheus")
subparser_prometheus_output.add_argument("t", "tags", help_text="specify report tags")
subparser_prometheus_output.add_argument("t", "tags", help_text=TAGS_ARGUMENT_HELP_TEXT)
subparser_prometheus_output.add_argument("u", "uri", help_text="specify server uri",

Check warning on line 259 in powerapi/cli/common_cli_parsing_manager.py

View check run for this annotation

Codecov / codecov/patch

powerapi/cli/common_cli_parsing_manager.py#L257-L259

Added lines #L257 - L259 were not covered by tests
default_value=DEFAULT_ADDRESS)
subparser_prometheus_output.add_argument(

Check warning on line 261 in powerapi/cli/common_cli_parsing_manager.py

View check run for this annotation

Codecov / codecov/patch

powerapi/cli/common_cli_parsing_manager.py#L261

Added line #L261 was not covered by tests
Expand Down Expand Up @@ -296,7 +298,7 @@ def __init__(self):
default_value="PowerReport",
)

subparser_csv_output.add_argument("t", "tags", help_text="specify report tags")
subparser_csv_output.add_argument("t", "tags", help_text=TAGS_ARGUMENT_HELP_TEXT)

Check warning on line 301 in powerapi/cli/common_cli_parsing_manager.py

View check run for this annotation

Codecov / codecov/patch

powerapi/cli/common_cli_parsing_manager.py#L301

Added line #L301 was not covered by tests
subparser_csv_output.add_argument(
"n", "name", help_text="specify pusher name", default_value="pusher_csv"
)
Expand All @@ -307,7 +309,7 @@ def __init__(self):

subparser_influx_output = SubgroupConfigParsingManager("influxdb")
subparser_influx_output.add_argument("u", "uri", help_text="specify InfluxDB uri")
subparser_influx_output.add_argument("t", "tags", help_text="specify report tags")
subparser_influx_output.add_argument("t", "tags", help_text=TAGS_ARGUMENT_HELP_TEXT)

Check warning on line 312 in powerapi/cli/common_cli_parsing_manager.py

View check run for this annotation

Codecov / codecov/patch

powerapi/cli/common_cli_parsing_manager.py#L312

Added line #L312 was not covered by tests
subparser_influx_output.add_argument(
"d", "db", help_text="specify InfluxDB database name"
)
Expand Down Expand Up @@ -353,7 +355,7 @@ def __init__(self):

subparser_influx2_output = SubgroupConfigParsingManager("influxdb2")
subparser_influx2_output.add_argument("u", "uri", help_text="specify InfluxDB uri")
subparser_influx2_output.add_argument("t", "tags", help_text="specify report tags")
subparser_influx2_output.add_argument("t", "tags", help_text=TAGS_ARGUMENT_HELP_TEXT)

Check warning on line 358 in powerapi/cli/common_cli_parsing_manager.py

View check run for this annotation

Codecov / codecov/patch

powerapi/cli/common_cli_parsing_manager.py#L358

Added line #L358 was not covered by tests
subparser_influx2_output.add_argument("k", "token",
help_text="specify token for accessing the database")
subparser_influx2_output.add_argument("g", "org",
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/database/test_prometheus_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _gen_url(port):


def test_create_direct_prometheus_db_and_connect_it_must_launch_web_server_on_given_address(db_info):
db, url = db_info
_, url = db_info
r = requests.get(url)
assert r.status_code == 200

Expand Down

0 comments on commit e60f2f6

Please sign in to comment.