flux-framework / flux-accounting

bank/accounting interface for the Flux resource manager
https://flux-framework.readthedocs.io/projects/flux-accounting/en/latest/index.html
GNU Lesser General Public License v3.0
3 stars 10 forks source link

`add-user`: make `--username` and `--bank` required arguments #532

Closed cmoussa1 closed 3 days ago

cmoussa1 commented 1 week ago

Problem

The --username and --bank arguments for add-user should be required arguments, but they are currently treated as optional arguments. This means that if someone calls add-user without passing --username or --bank, the corresponding add_user() function will try to run the function with None values. Requirements should be added for both of these arguments at the top level so that the call fails if either one of these is not present.


This PR adds required=True to both the --username and --bank arguments in add-user. I've also added two tests to t1007-flux-account-users.t to make sure errors are raised when either one of these is missing from the add-user call.

Fixes #531

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.40%. Comparing base (b0bd954) to head (73a0ef9). Report is 54 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #532 +/- ## ======================================= Coverage 82.40% 82.40% ======================================= Files 20 20 Lines 1478 1478 ======================================= Hits 1218 1218 Misses 260 260 ```
cmoussa1 commented 3 days ago

Rebased to catch up here too. Setting MWP