Skip to content

Commit

Permalink
outputs properly formmated json dump
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed Sep 27, 2024
1 parent 24656eb commit cd49e3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion aim/cli/digifeeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from aim.digifeeds.add_to_db import add_to_db as add_to_digifeeds_db
from aim.digifeeds.list_barcodes_in_bucket import list_barcodes_in_bucket
from aim.digifeeds.database import models, main
import json
import sys


app = typer.Typer()
Expand All @@ -21,4 +23,4 @@ def load_statuses():

@app.command()
def list_barcodes_in_input_bucket():
print(list_barcodes_in_bucket(), end="")
json.dump(list_barcodes_in_bucket(), sys.stdout)
2 changes: 1 addition & 1 deletion tests/cli/test_digifeeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ def test_list_barcodes_in_input_bucket(mocker):
result = runner.invoke(app, ["digifeeds", "list-barcodes-in-input-bucket"])
assert list_barcodes_mock.call_count == 1
assert result.exit_code == 0
assert "['barcode1', 'barcode2']" == result.stdout
assert '["barcode1", "barcode2"]' == result.stdout

0 comments on commit cd49e3d

Please sign in to comment.