Skip to content

Commit

Permalink
t: add tests for list-banks command
Browse files Browse the repository at this point in the history
Problem: There exists no tests for the list-banks command.

Add a couple tests, such as calling the command by default, including
inactive banks, and customizing output.
  • Loading branch information
cmoussa1 committed Aug 1, 2024
1 parent a39f2c5 commit 692fec5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions t/t1023-flux-account-banks.t
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,27 @@ test_expect_success 'trying to add a user to a nonexistent bank should raise a V
grep "Bank foo does not exist in bank_table" nonexistent_bank.out
'

test_expect_success 'call list-banks --help' '
flux account list-banks --help
'

test_expect_success 'call list-banks' '
flux account list-banks
'

test_expect_success 'call list-banks and include inactive banks' '
flux account list-banks --inactive
'

test_expect_success 'call list-banks and customize output' '
flux account list-banks --fields=bank_id,bank
'

test_expect_success 'call list-banks with a bad field' '
test_must_fail flux account list-banks --fields=bank_id,foo > error.out 2>&1 &&
grep "invalid fields: foo" error.out
'

test_expect_success 'remove flux-accounting DB' '
rm $(pwd)/FluxAccountingTest.db
'
Expand Down

0 comments on commit 692fec5

Please sign in to comment.