Skip to content

Commit

Permalink
t: change which user is deleted from table
Browse files Browse the repository at this point in the history
Problem: There is a test in t1023-flux-account-banks.t that makes sure
the default bank of a user is updated when one of their user/bank rows
is deleted from the database by removing it in the test prior, but the
wrong user is deleted.

Change which user is deleted in t1023-flux-account-banks.t. Make the
"grep" check in the subsequent test more robust by checking that all
three of the expected strings show up in the .out file instead of
checking that the .out file contains any whole-word matches for just
one of the patterns searched.
  • Loading branch information
cmoussa1 committed Nov 6, 2024
1 parent cb34b27 commit 87301bb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions t/t1023-flux-account-banks.t
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,14 @@ test_expect_success 'add a user to two different banks' '
'

test_expect_success 'delete user default bank row' '
flux account delete-user user5013 E
flux account delete-user user5015 E
'

test_expect_success 'check that user default bank gets updated to other bank' '
flux account view-user user5015 > new_default_bank.out &&
cat new_default_bank.out &&
grep -w "username: user5015\|bank: F\|default_bank: F" new_default_bank.out
grep "username: user5015" new_default_bank.out &&
grep "bank: F" new_default_bank.out &&
grep "default_bank: F" new_default_bank.out
'

test_expect_success 'trying to add a user to a nonexistent bank should raise a ValueError' '
Expand Down

0 comments on commit 87301bb

Please sign in to comment.