working commit
This commit is contained in:
@@ -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)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user