Add torrent tests

Fixes #1128
This commit is contained in:
Joseph Schorr 2016-01-19 15:52:34 -05:00
parent fa57100cd5
commit 68c9d5e432
2 changed files with 159 additions and 60 deletions

View file

@ -15,6 +15,15 @@ class FakeStorage(BaseStorageV2):
def _init_path(self, path=None, create=False):
return path
def get_direct_download_url(self, path, expires_in=60, requires_cors=False):
try:
if self.get_content('supports_direct_download') == 'true':
return 'http://somefakeurl'
except:
pass
return None
def get_content(self, path):
if not path in _FAKE_STORAGE_MAP:
raise IOError('Fake file %s not found' % path)