Closed chrisbillows closed 9 months ago
Approach is going to be:
1) Fetch new RAINDROP_OAUTH_TOKEN and pass into method 2) Read .env file into memory as a list using with/readlines. 3) Use a for loop to identify the line that contains the old RAINDROP_OAUTH_TOKEN. 4) Overwrite the old token with the new token in the list. 5) Use with in "w" mode to f.write("".join(new_content))
This functionality will replace the existing: RaindropOauthHandler.__write_token_to_env()
Other considerations:
access_token
RaindropOauthHandler
has two runner methods - new_token_process_runner
and refresh_token_process_runner
grant_type
: authorization_code
or refresh_token
write_access_token_to_env
new_token_process_runner
has not been used and needs to be looked at with a view to eventual automation
First step is to revise TestWritetoEnv in test_raindrop_oauth.py
.
The existing test does not work!
The new Raindrop Oauth methods are written with passing tests:
_create_updated_env_body
_new_env_validator
_write_new_body_to_env
The next step is to revise:
new_token_process_runner
refresh_token_process_runner
The _new_env_validator
call is not present in either.
Tests will drift toward integration tests.