Add the sync server task.
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-23 22:14:19 +02:00
parent b8a7ac9a48
commit 1b27b07268
4 changed files with 67 additions and 1 deletions
@@ -0,0 +1,31 @@
defmodule DecentralisedBookIndex.Sync.SyncServerTaskTest do
use DecentralisedBookIndex.DataCase
alias DecentralisedBookIndex.Sync.SyncServerTask
alias DecentralisedBookIndex.Sync.ApiClients.FetchJson
alias DecentralisedBookIndex.Sync.AuthorSync
alias DecentralisedBookIndex.Metadata
alias DecentralisedBookIndex.TestEndpoints
@test_server_endpoint TestEndpoints.test_api_endpoint()
describe "sync all" do
test "servers" do
server = generate(dbi_server(url: @test_server_endpoint))
{:ok, author} = Metadata.create_author("Author", "An description")
assert server = SyncServerTask.sync_all()
end
end
describe "sync one" do
test "server" do
server = generate(dbi_server(url: @test_server_endpoint))
{:ok, author} = Metadata.create_author("Author", "An description")
assert server = SyncServerTask.sync_one(server)
end
end
end