chrisbillows / raindrop-todoist-syncer

Converts favourited Raindrops into tasks in Todoist.
2 stars 1 forks source link

New oauth token's are written incorrectly to .env #3

Closed chrisbillows closed 9 months ago

chrisbillows commented 9 months ago
chrisbillows commented 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:

chrisbillows commented 9 months ago

First step is to revise TestWritetoEnv in test_raindrop_oauth.py.

The existing test does not work!

chrisbillows commented 9 months ago

The new Raindrop Oauth methods are written with passing tests:

The next step is to revise:

The _new_env_validator call is not present in either.

Tests will drift toward integration tests.