Skip to content

Commit

Permalink
Merge pull request #95 from rinslow/feature/add-config-to-rundata
Browse files Browse the repository at this point in the history
Casted output handlers to list after usage.
  • Loading branch information
osherdp committed Sep 20, 2018
2 parents 06fb68e + 0f62523 commit fbf8a23
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Setup file for handling packaging and distribution."""
from setuptools import setup, find_packages

__version__ = "4.1.0"
__version__ = "4.1.1"

result_handlers = [
"db = rotest.core.result.handlers.db_handler:DBHandler",
Expand Down
6 changes: 3 additions & 3 deletions src/rotest/cli/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ def parse_outputs_option(outputs):
if not outputs:
return None

requested_handlers = set(outputs.split(","))
requested_handlers = outputs.split(",")

available_handlers = set(get_result_handlers())
available_handlers = get_result_handlers()

non_existing_handlers = requested_handlers - available_handlers
non_existing_handlers = set(requested_handlers) - set(available_handlers)

if non_existing_handlers:
raise ValueError("The following output handlers are not "
Expand Down
3 changes: 0 additions & 3 deletions src/rotest/core/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ def parse_config_file(json_path, schema_path=DEFAULT_SCHEMA_PATH):
config = parse(json_path=json_path,
schema_path=schema_path)

if "outputs" in config:
config.outputs = set(config.outputs)

return config


Expand Down
6 changes: 3 additions & 3 deletions tests/cli/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MockCase(TestCase):

def test_parsing_output_handlers():
outputs = parse_outputs_option("pretty,xml,excel")
assert outputs == {"pretty", "xml", "excel"}
assert outputs == ["pretty", "xml", "excel"]


def test_bad_option_in_output_parser():
Expand Down Expand Up @@ -51,7 +51,7 @@ def test_setting_options_by_config(run_tests):

config = AttrDict(delta_iterations=5, processes=2,
paths=(".",), config_path="config.json",
outputs={"xml", "remote"}, filter="MockCase",
outputs=["xml", "remote"], filter="MockCase",
run_name="some name", resources="query", debug=False,
fail_fast=False, list=False, save_state=False,
skip_init=False)
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_setting_options_by_cli(run_tests):

config = AttrDict(delta_iterations=4, processes=1,
paths=(".",), config_path="config.json",
outputs={"pretty", "full"}, filter="MockCase",
outputs=["pretty", "full"], filter="MockCase",
run_name="other name", resources="other query",
debug=True, fail_fast=True, list=True, save_state=True,
skip_init=True)
Expand Down

0 comments on commit fbf8a23

Please sign in to comment.