From 692fec54fc5ae96437f84153c5e8df7f4d615232 Mon Sep 17 00:00:00 2001 From: cmoussa1 Date: Thu, 1 Aug 2024 11:27:54 -0700 Subject: [PATCH] t: add tests for list-banks command 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. --- t/t1023-flux-account-banks.t | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/t/t1023-flux-account-banks.t b/t/t1023-flux-account-banks.t index 7b5f9f8fc..98b34c863 100755 --- a/t/t1023-flux-account-banks.t +++ b/t/t1023-flux-account-banks.t @@ -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 '