Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default value for content files argument #7

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/webmonchow/amq/broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get_options(argv):
"-m",
help="List of content files to broadcast, separated by comma.",
dest="content_files" "",
default=service_content_files(),
default=",".join(service_content_files()),
)
options = parser.parse_args(argv)
return options
Expand Down
3 changes: 1 addition & 2 deletions src/webmonchow/pv/broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,8 @@ def get_options(argv):
parser.add_argument("--database-name", dest="database", default=os.getenv("DATABASE_NAME", "workflow"))
parser.add_argument(
"--pv-files",
"-f",
dest="pv_files",
default=service_content_files(),
default=",".join(service_content_files()),
help="List of content files to broadcast, separated by commas",
)
options = parser.parse_args(argv)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_amq_broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_get_options_default():
assert options.user == "icat"
assert options.password == "icat"
assert options.broker == "localhost:61613"
file_names = [os.path.basename(filename) for filename in options.content_files]
file_names = [os.path.basename(filename) for filename in options.content_files.split(",")]
assert sorted(file_names) == ["dasmon.json", "pvsd.json", "translation.json"]


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_pv_broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_get_options_default():
assert options.host == "localhost"
assert options.port == "5432"
assert options.database == "workflow"
assert options.pv_files[0].endswith("services/dasmon.json")
assert os.path.basename(options.pv_files) == "dasmon.json"


def test_get_options():
Expand Down
Loading