-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add validity check for logging #161
chore: add validity check for logging #161
Conversation
command = [ | ||
"copernicusmarine", | ||
"login", | ||
"--username", | ||
f"{os.getenv('COPERNICUSMARINE_SERVICE_USERNAME')}", | ||
"--password", | ||
f"{os.getenv('COPERNICUSMARINE_SERVICE_PASSWORD')}", | ||
"--configuration-file-directory", | ||
f"{non_existing_directory}", | ||
] | ||
|
||
self.output = execute_in_terminal(command) | ||
|
||
environment_without_crendentials = ( | ||
get_environment_without_crendentials() | ||
) | ||
|
||
command = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we rewriting the definition of the command
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and we are using the same 'self' then to assert... makes for a weird test, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because in python you can :D the object is just overwritten and since we don't need both at the same time, why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean we don't need both but if we overwrite the self.output we destroy the test, no? (or is it appended and then my question makes no sense?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean we destroy the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And no it's not appended, but in the whole test suit we do: self.output =
assert (folder / ".copernicusmarine-credentials").is_file() | ||
assert login( | ||
check_credentials_valid=True, | ||
) | ||
|
||
assert not login( | ||
username="toto", | ||
password="tutu", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't you add a test specific also for the option that you created? For the python interface a little more extensive? Or with the cli tests it will be enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically the CLI and the python interface sends to the same function to I am checking that the arguments work
ff3ee7e
to
bfd1fdf
Compare
Add a functionality to check if the user's credentials are valid. Deletes the `--skip-if-logged-in` functionality
Add a functionality to check if the user's credentials are valid. Deletes the `--skip-if-logged-in` functionality
Fix CMT-110
Allow user to check the validity of their credentials