Files
OpenFlare/internal/apps/upload/ingest/local_file_test.go
T
ryan 346024f346 feat(relay): support configurable frps webui port and fix node detail integration
- Implement configurable FRPS WebUI switch and custom port setting (relay_frps_web_ui_port) in system configs.
- Integrate settings into Relay Node detail manage page instead of global settings.
- Dynamically query server version to select matching Docker image tag for Relay installation.
- Clean up legacy code and fix backend linter/test warnings.
2026-06-22 12:48:54 +08:00

37 lines
891 B
Go

// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
package ingest
import (
"context"
"os"
"path/filepath"
"testing"
)
func TestResolveLocalFileFindsStoredPath(t *testing.T) {
dir := t.TempDir()
artifactPath := filepath.Join(dir, "legacy.zip")
if err := os.WriteFile(artifactPath, []byte("legacy"), 0o644); err != nil {
t.Fatalf("write artifact: %v", err)
}
path, size, err := ResolveLocalFile(context.Background(), LocalFileCandidateRequest{
StoredPath: artifactPath,
})
if err != nil {
t.Fatalf("ResolveLocalFile failed: %v", err)
}
if path != artifactPath || size != int64(len("legacy")) {
t.Fatalf("unexpected resolve result: path=%q size=%d", path, size)
}
}
func TestFromLocalPathRequiresPath(t *testing.T) {
_, err := FromLocalPath(context.Background(), "", Request{})
if err == nil {
t.Fatal("expected error for empty local path")
}
}