Skip to content

Commit

Permalink
Fix verdi config set with empty profile
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Feb 3, 2024
1 parent b7e59a0 commit 9fc5b90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/aiida/cmdline/commands/cmd_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def verdi_config_set(ctx, option, value, globally, append, remove):
echo.echo_critical('Cannot flag both append and remove')

config: Config = ctx.obj.config
profile: Profile | None = ctx.obj.profile
profile: Profile | None = ctx.obj.get('profile', None)

if option.global_only:
globally = True
Expand Down
4 changes: 4 additions & 0 deletions tests/cmdline/commands/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def test_config_set_option_no_profile(run_cli_command, empty_config):
run_cli_command(cmd_verdi.verdi, options, use_subprocess=False)
assert str(config.get_option(option_name, scope=None)) == option_value

# Issue xxx: profile attribute not exist for an actual empty config
result = run_cli_command(cmd_verdi.verdi, options, use_subprocess=True)
assert 'Success: ' in result.output


@pytest.mark.parametrize(
'option_name, is_list',
Expand Down

0 comments on commit 9fc5b90

Please sign in to comment.