mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-14 22:45:47 +00:00
allow to use multiple upload and report targets with the same name
In this feature target option must allways point to section name instead of type. Type will be read from type option. In case if type option is not presented it will try to check if section with architecture exists (e.g. target = email, section = email:x86_64); if it does, the correct section name and type will be used. Otherwise it will check if the specified section exists; if it does, seection name and type will be returned.
This commit is contained in:
@ -15,7 +15,7 @@ def test_upload_failure(configuration: Configuration, mocker: MockerFixture) ->
|
||||
"""
|
||||
mocker.patch("ahriman.core.upload.rsync.Rsync.sync", side_effect=Exception())
|
||||
with pytest.raises(SyncFailed):
|
||||
Upload.load("x86_64", configuration, UploadSettings.Rsync.name).run(Path("path"), [])
|
||||
Upload.load("x86_64", configuration, "rsync").run(Path("path"), [])
|
||||
|
||||
|
||||
def test_report_dummy(configuration: Configuration, mocker: MockerFixture) -> None:
|
||||
@ -24,7 +24,7 @@ def test_report_dummy(configuration: Configuration, mocker: MockerFixture) -> No
|
||||
"""
|
||||
mocker.patch("ahriman.models.upload_settings.UploadSettings.from_option", return_value=UploadSettings.Disabled)
|
||||
upload_mock = mocker.patch("ahriman.core.upload.upload.Upload.sync")
|
||||
Upload.load("x86_64", configuration, UploadSettings.Disabled.name).run(Path("path"), [])
|
||||
Upload.load("x86_64", configuration, "disabled").run(Path("path"), [])
|
||||
upload_mock.assert_called_once()
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ def test_upload_rsync(configuration: Configuration, mocker: MockerFixture) -> No
|
||||
must upload via rsync
|
||||
"""
|
||||
upload_mock = mocker.patch("ahriman.core.upload.rsync.Rsync.sync")
|
||||
Upload.load("x86_64", configuration, UploadSettings.Rsync.name).run(Path("path"), [])
|
||||
Upload.load("x86_64", configuration, "rsync").run(Path("path"), [])
|
||||
upload_mock.assert_called_once()
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ def test_upload_s3(configuration: Configuration, mocker: MockerFixture) -> None:
|
||||
must upload via s3
|
||||
"""
|
||||
upload_mock = mocker.patch("ahriman.core.upload.s3.S3.sync")
|
||||
Upload.load("x86_64", configuration, UploadSettings.S3.name).run(Path("path"), [])
|
||||
Upload.load("x86_64", configuration, "customs3").run(Path("path"), [])
|
||||
upload_mock.assert_called_once()
|
||||
|
||||
|
||||
@ -51,5 +51,5 @@ def test_upload_github(configuration: Configuration, mocker: MockerFixture) -> N
|
||||
must upload via github
|
||||
"""
|
||||
upload_mock = mocker.patch("ahriman.core.upload.github.Github.sync")
|
||||
Upload.load("x86_64", configuration, UploadSettings.Github.name).run(Path("path"), [])
|
||||
Upload.load("x86_64", configuration, "github").run(Path("path"), [])
|
||||
upload_mock.assert_called_once()
|
||||
|
Reference in New Issue
Block a user