Skip to content

Commit

Permalink
Tests: Fix failing tests/cmdline/commands/test_setup.py
Browse files Browse the repository at this point in the history
The previous commit fixed a bug in the evaluation of defaults for
various options of the `verdi setup` command. Due to the bug, these
options would set a default even if the corresponding config option was
not defined. Instead of no default being defined, the empty tuple `()`
would be set as string value.

As soon as the bug was fixed, the `test_setup_profile_uuid` test started
failing since it doesn't explicitly defined values for the options
`--email`, `--first-name`, `--last-name` and `--institution`.
  • Loading branch information
sphuber committed Oct 11, 2023
1 parent 275718c commit b6f7ec1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/cmdline/commands/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,15 @@ def test_setup_profile_uuid(self):

profile_name = 'profile-copy'
user_email = '[email protected]'
profile_uuid = str(uuid.uuid4)
user_first_name = 'John'
user_last_name = 'Smith'
user_institution = 'ECMA'
profile_uuid = str(uuid.uuid4())
options = [
'--non-interactive', '--profile', profile_name, '--profile-uuid', profile_uuid, '--db-backend',
self.storage_backend_name, '--db-name', db_name, '--db-username', db_user, '--db-password', db_pass,
'--db-port', self.pg_test.dsn['port'], '--email', user_email
'--non-interactive', '--email', user_email, '--first-name', user_first_name, '--last-name', user_last_name,
'--institution', user_institution, '--db-name', db_name, '--db-username', db_user, '--db-password', db_pass,
'--db-port', self.pg_test.dsn['port'], '--db-backend', self.storage_backend_name, '--profile', profile_name,
'--profile-uuid', profile_uuid
]

self.cli_runner(cmd_setup.setup, options, use_subprocess=False)
Expand All @@ -219,4 +223,4 @@ def test_setup_profile_uuid(self):
assert profile_name in config.profile_names

profile = config.get_profile(profile_name)
profile.uuid = profile_uuid
assert profile.uuid == profile_uuid

0 comments on commit b6f7ec1

Please sign in to comment.