Skip to content

Commit

Permalink
WIP CLI query archive output format
Browse files Browse the repository at this point in the history
  • Loading branch information
jlumpe committed Aug 4, 2024
1 parent 007866b commit 892c795
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gambit/cli/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ def get_exporter(outfmt: str):
return JSONResultsExporter()

if outfmt == 'archive':
return ResultsArchiveWriter(install_info=True)
return ResultsArchiveWriter()

assert 0
raise ValueError(f'Invalid output format: {outfmt!r}')


@cli.command(name='query', no_args_is_help=True)
Expand Down
6 changes: 6 additions & 0 deletions tests/cli/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ def check_results(results_file: Path, out_fmt: str, ref_results: QueryResults):
if out_fmt == 'json':
with open(results_file) as fh:
check_json_results(fh, ref_results, strict=False)

elif out_fmt == 'csv':
with open(results_file) as fh:
check_csv_results(fh, ref_results, strict=False)

elif out_fmt == 'archive':
assert results_file.is_file() # TODO

else:
raise ValueError(f'Invalid out_fmt {out_fmt!r}')

Expand All @@ -85,6 +90,7 @@ def check_results(results_file: Path, out_fmt: str, ref_results: QueryResults):
(20, False, 'csv', True, False),
(None, False, 'json', False, True),
(20, True, 'json', False, False),
(20, False, 'archive', False, False),
],
)
def test_full_query(testdb: TestDB,
Expand Down

0 comments on commit 892c795

Please sign in to comment.