mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 10:04:55 +08:00
feat(patch):统一清单驱动汉化发布
This commit is contained in:
@@ -797,6 +797,38 @@ func TestLocalizedPublishSendsWorkerSourceAndReleaseOptions(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLocalizedPublishSendsPatchManifestSource(t *testing.T) {
|
||||
client := newTestClient(t, func(t *testing.T, req testRequest) testResponse {
|
||||
var params LocalizedPublishParams
|
||||
if err := json.Unmarshal(req.Params, ¶ms); err != nil {
|
||||
t.Fatalf("decode params: %v", err)
|
||||
}
|
||||
if params.PatchManifest != "/tmp/patch-manifest.json" ||
|
||||
params.TranslationFile != "" || params.FromWorker {
|
||||
t.Fatalf("params = %#v", params)
|
||||
}
|
||||
return testResponse{
|
||||
Result: testEnvelope{
|
||||
OK: true,
|
||||
Status: "ok",
|
||||
RequestID: "req-test-localized-patch-manifest",
|
||||
Data: map[string]any{"status": "published"},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
raw, err := client.LocalizedPublish(context.Background(), LocalizedPublishParams{
|
||||
PatchManifest: "/tmp/patch-manifest.json",
|
||||
LocalizedReleaseID: "localized-v1",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("LocalizedPublish error: %v", err)
|
||||
}
|
||||
if !json.Valid(raw) {
|
||||
t.Fatalf("invalid raw JSON: %s", string(raw))
|
||||
}
|
||||
}
|
||||
|
||||
func TestLocalizedRollbackSendsExpectedRelease(t *testing.T) {
|
||||
client := newTestClient(t, func(t *testing.T, req testRequest) testResponse {
|
||||
if req.Method != "localized.rollback" {
|
||||
|
||||
Reference in New Issue
Block a user