Add tests for SelfPost
This commit is contained in:
@@ -43,10 +43,13 @@ class Resource:
|
||||
content = self.retry_download(self.url, 0)
|
||||
if content:
|
||||
self.content = content
|
||||
self.hash = hashlib.md5(self.content)
|
||||
self.create_hash()
|
||||
else:
|
||||
raise BulkDownloaderException('Could not download resource')
|
||||
|
||||
def create_hash(self):
|
||||
self.hash = hashlib.md5(self.content)
|
||||
|
||||
def _determine_extension(self) -> str:
|
||||
extension_pattern = r'.*(\..{3,5})$'
|
||||
match = re.search(extension_pattern, self.url)
|
||||
|
||||
Reference in New Issue
Block a user