mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-07-24 07:20:41 -04:00
CR fixes
This commit is contained in:
parent
ce0fa21f94
commit
1168bcf7ff
3 changed files with 120 additions and 66 deletions
|
@ -8,7 +8,7 @@ from nio import RoomMessage, RoomEncryptedMedia
|
|||
from urllib.parse import urlparse
|
||||
from conftest import faker
|
||||
from pantalaimon.index import INDEXING_ENABLED
|
||||
from pantalaimon.store import FetchTask, MediaInfo
|
||||
from pantalaimon.store import FetchTask, MediaInfo, UploadInfo
|
||||
|
||||
TEST_ROOM = "!SVkFJHzfwvuaIEawgC:localhost"
|
||||
TEST_ROOM2 = "!testroom:localhost"
|
||||
|
@ -177,3 +177,19 @@ class TestClass(object):
|
|||
media_info = media_cache[(mxc_server, mxc_path)]
|
||||
assert media_info == media
|
||||
assert media_info == panstore.load_media(server_name, mxc_server, mxc_path)
|
||||
|
||||
def test_upload_storage(self, panstore):
|
||||
event = self.encrypted_media_event
|
||||
|
||||
assert not panstore.load_upload(event.url)
|
||||
|
||||
upload = UploadInfo(event.url, event.key, event.iv, event.hashes)
|
||||
|
||||
panstore.save_upload(event.url)
|
||||
|
||||
upload_cache = panstore.load_upload(event.url)
|
||||
|
||||
assert (event.url) in upload_cache
|
||||
upload_info = upload_cache[(event.url)]
|
||||
assert upload_info == upload
|
||||
assert upload_info == panstore.load_upload(event.url)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue