-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from joanbm/remove_attachment_download_login_wo…
…rkaround Remove attachment download login workaround
- Loading branch information
Showing
8 changed files
with
37 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,9 +33,7 @@ def test_on_download_with_attachments_calls_controller_with_attachments(): | |
|
||
# Act | ||
frontend.run("util", ["download", "--with-attachments"], | ||
{"TODOIST_TOKEN": "1234", | ||
"TODOIST_EMAIL": "[email protected]", | ||
"TODOIST_PASSWORD": "1234"}) | ||
{"TODOIST_TOKEN": "1234"}) | ||
|
||
# Assert | ||
controller.download.assert_called_with(ANY, with_attachments=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,9 +45,9 @@ def setUp(self): | |
Path(self.__get_test_file("sources/Project_2181147712.csv")).read_bytes(), | ||
("POST", "/https://api.todoist.com/sync/v9/templates/export_as_file", b"project_id=2181147713", 'mysecrettoken'): | ||
Path(self.__get_test_file("sources/Project_2181147713.csv")).read_bytes(), | ||
("GET, /https://d1x0mwiac2rqwt.cloudfront.net/g75-kL8pwVYNObSczLnVXe4FIyJd8YQL6b8yCilGyix09bMdJmxbtrGMW9jIeIwJ/by/16542905/as/bug.txt", None, None): | ||
("GET", "/https://d1x0mwiac2rqwt.cloudfront.net/g75-kL8pwVYNObSczLnVXe4FIyJd8YQL6b8yCilGyix09bMdJmxbtrGMW9jIeIwJ/by/16542905/as/bug.txt", None, None): | ||
Path(self.__get_test_file("sources/bug.txt")).read_bytes(), | ||
("GET, /https://d1x0mwiac2rqwt.cloudfront.net/s0snyb7n9tJXYijOK2LV6hjVar4YUkwYbHv3PBFYM-N4nJEtujC046OlEdZpKfZm/by/16542905/as/sample_image.png", None, None): | ||
("GET", "/https://d1x0mwiac2rqwt.cloudfront.net/s0snyb7n9tJXYijOK2LV6hjVar4YUkwYbHv3PBFYM-N4nJEtujC046OlEdZpKfZm/by/16542905/as/sample_image.png", None, None): | ||
Path(self.__get_test_file("sources/sample_image.png")).read_bytes(), | ||
} | ||
|
||
|
@@ -86,11 +86,8 @@ def __compare_zip_files(self, zip_path_1, zip_path_2): | |
self.assertEqual(content_1, content_2) | ||
|
||
@patch.object(sys, 'argv', ["program", "download", "--with-attachments"]) | ||
@patch.object(os, 'environ', {"TODOIST_TOKEN": "mysecrettoken", | ||
"TODOIST_EMAIL": "[email protected]", | ||
"TODOIST_PASSWORD": "mysecretpassword"}) | ||
@patch.object(os, 'environ', {"TODOIST_TOKEN": "mysecrettoken"}) | ||
@patch.object(urllib.request.OpenerDirector, 'open', autospec=True) | ||
@unittest.skip("Not yet adapted to mock the attachment download workaround") | ||
def test_integration_download_with_attachments(self, mock_opener_open): | ||
""" Integration test for downloading the backup with attachments """ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters