forked from ipfs/go-ipfs-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathipns_test.go
38 lines (30 loc) · 941 Bytes
/
ipns_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package shell
import (
"fmt"
"testing"
"time"
)
var examplesHashForIPNS = "/ipfs/Qmbu7x6gJbsKDcseQv66pSbUcAA3Au6f7MfTYVXwvBxN2K"
var testKey = "self" // feel free to change to whatever key you have locally
func TestPublishDetailsWithKey(t *testing.T) {
t.Skip()
shell := NewShell("localhost:5001")
resp, err := shell.PublishWithDetails(examplesHashForIPNS, testKey, time.Second, time.Second, false)
if err != nil {
t.Fatal(err)
}
if resp.Value != examplesHashForIPNS {
t.Fatalf(fmt.Sprintf("Expected to receive %s but got %s", examplesHash, resp.Value))
}
}
func TestPublishDetailsWithoutKey(t *testing.T) {
t.Skip()
shell := NewShell("localhost:5001")
resp, err := shell.PublishWithDetails(examplesHashForIPNS, "", time.Second, time.Second, false)
if err != nil {
t.Fatal(err)
}
if resp.Value != examplesHashForIPNS {
t.Fatalf(fmt.Sprintf("Expected to receive %s but got %s", examplesHash, resp.Value))
}
}