-
Notifications
You must be signed in to change notification settings - Fork 94
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 #575 from fukatani/issue/571
[breaking consistency] Unsupport --overwrite option and abort download if file already exists.
- Loading branch information
Showing
4 changed files
with
74 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import unittest | ||
|
||
import requests.exceptions | ||
import tests.command_download | ||
|
||
|
||
class DownloadInvalid(unittest.TestCase): | ||
def snippet_call_download_raises(self, *args, **kwargs): | ||
tests.command_download.snippet_call_download_raises(self, *args, **kwargs) | ||
|
||
def snippet_call_download_twice(self, *args, **kwargs): | ||
tests.command_download.snippet_call_download_twice(self, *args, **kwargs) | ||
|
||
def test_call_download_invalid(self): | ||
self.snippet_call_download_raises(requests.exceptions.InvalidURL, 'https://not_exist_contest.jp/tasks/001_a') | ||
|
||
def test_call_download_twice(self): | ||
self.snippet_call_download_twice('https://atcoder.jp/contests/abc114/tasks/abc114_c', 'https://atcoder.jp/contests/abc003/tasks/abc003_4', [ | ||
{ | ||
"input": "575\n", | ||
"output": "4\n" | ||
}, | ||
{ | ||
"input": "3600\n", | ||
"output": "13\n" | ||
}, | ||
{ | ||
"input": "999999999\n", | ||
"output": "26484\n" | ||
}, | ||
], type='json') |