working commit

This commit is contained in:
2026-02-02 14:08:38 +02:00
parent 8e9c270972
commit c973fccc86
3 changed files with 45 additions and 12 deletions
+17
View File
@@ -57,6 +57,7 @@ func TestService(t *testing.T) {
time.Sleep(1 * time.Second)
}
{
// ServiceHello
fmt.Printf("=== ServiceHello ===\n")
cli := NewClient()
ctx := context.Background()
@@ -67,6 +68,7 @@ func TestService(t *testing.T) {
require.True(t, helloRes)
}
{
// PutFile
tmpdir := t.TempDir()
tmpfile := filepath.Join(tmpdir, "foo.bin")
@@ -86,4 +88,19 @@ func TestService(t *testing.T) {
require.NoError(t, err)
}
{
// GetFile
fmt.Printf("=== GetFil ===\n")
cli := NewClient()
ctx := context.Background()
ctx, _ = context.WithTimeout(ctx, 1*time.Second)
tmpdir := t.TempDir()
tmpfile := filepath.Join(tmpdir, "foo.bin")
_, err = cli.GetFile(ctx, srvaddr+"/foo.bin", tmpfile)
require.NoError(t, err)
}
}