mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-08-27 03:49:57 +00:00
Native s3 sync (#23)
* Native S3 sync implementation * fix imports * fix paths reading * install s3 components duriing test stage
This commit is contained in:
22
tests/ahriman/core/upload/conftest.py
Normal file
22
tests/ahriman/core/upload/conftest.py
Normal file
@ -0,0 +1,22 @@
|
||||
import pytest
|
||||
|
||||
from collections import namedtuple
|
||||
from typing import List
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from ahriman.core.configuration import Configuration
|
||||
from ahriman.core.upload.s3 import S3
|
||||
|
||||
|
||||
_s3_object = namedtuple("s3_object", ["key", "e_tag", "delete"])
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def s3(configuration: Configuration) -> S3:
|
||||
return S3("x86_64", configuration)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def s3_remote_objects() -> List[_s3_object]:
|
||||
delete_mock = MagicMock()
|
||||
return list(map(lambda item: _s3_object(f"x86_64/{item}", f"\"{item}\"", delete_mock), ["a", "b", "c"]))
|
Reference in New Issue
Block a user