File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
src/simcore_service_invitations Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ def invite(
106106 None ,
107107 help = InvitationInputs .model_fields ["trial_account_days" ].description ,
108108 ),
109+ extra_credits_in_usd : int = typer .Option (
110+ None ,
111+ help = InvitationInputs .model_fields ["extra_credits_in_usd" ].description ,
112+ ),
109113 product : str = typer .Option (
110114 None ,
111115 help = InvitationInputs .model_fields ["product" ].description ,
@@ -119,7 +123,7 @@ def invite(
119123 issuer = issuer ,
120124 guest = TypeAdapter (EmailStr ).validate_python (email ),
121125 trial_account_days = trial_account_days ,
122- extra_credits_in_usd = None ,
126+ extra_credits_in_usd = extra_credits_in_usd ,
123127 product = product ,
124128 )
125129
Original file line number Diff line number Diff line change @@ -45,9 +45,8 @@ def test_invite_user_and_check_invitation(
4545 "INVITATIONS_DEFAULT_PRODUCT" : default_product ,
4646 }
4747
48- expected = {
48+ expected_invitation = {
4949 ** invitation_data .model_dump (exclude = {"product" }),
50- "extra_credits_in_usd" : None , # Cannot be set from CLI
5150 "product" : environs ["INVITATIONS_DEFAULT_PRODUCT" ],
5251 }
5352
@@ -56,6 +55,11 @@ def test_invite_user_and_check_invitation(
5655 if invitation_data .trial_account_days :
5756 other_options = f"--trial-account-days={ invitation_data .trial_account_days } "
5857
58+ if invitation_data .extra_credits_in_usd :
59+ other_options += (
60+ f" --extra-credits-in-usd={ invitation_data .extra_credits_in_usd } "
61+ )
62+
5963 result = cli_runner .invoke (
6064 main ,
6165 f"invite { invitation_data .guest } --issuer={ invitation_data .issuer } { other_options } " ,
@@ -74,7 +78,7 @@ def test_invite_user_and_check_invitation(
7478 )
7579 assert result .exit_code == os .EX_OK , result .output
7680 assert (
77- expected
81+ expected_invitation
7882 == TypeAdapter (InvitationInputs ).validate_json (result .stdout ).model_dump ()
7983 )
8084
Original file line number Diff line number Diff line change @@ -42,3 +42,5 @@ def test_valid_application_settings(app_environment: EnvVarsDict):
4242 assert settings
4343
4444 assert settings == ApplicationSettings .create_from_envs ()
45+
46+ assert settings .LOG_LEVEL == "INFO"
You can’t perform that action at this time.
0 commit comments