OSDN Git Service

add ipfs package
[bytom/vapor.git] / vendor / github.com / ipfs / go-ipfs-api / ipns_test.go
1 package shell
2
3 import (
4         "fmt"
5         "testing"
6         "time"
7 )
8
9 var examplesHashForIPNS = "/ipfs/Qmbu7x6gJbsKDcseQv66pSbUcAA3Au6f7MfTYVXwvBxN2K"
10 var testKey = "self" // feel free to change to whatever key you have locally
11
12 func TestPublishDetailsWithKey(t *testing.T) {
13         t.Skip()
14         shell := NewShell("localhost:5001")
15
16         resp, err := shell.PublishWithDetails(examplesHashForIPNS, testKey, time.Second, time.Second, false)
17         if err != nil {
18                 t.Fatal(err)
19         }
20
21         if resp.Value != examplesHashForIPNS {
22                 t.Fatalf(fmt.Sprintf("Expected to receive %s but got %s", examplesHash, resp.Value))
23         }
24 }
25
26 func TestPublishDetailsWithoutKey(t *testing.T) {
27         t.Skip()
28         shell := NewShell("localhost:5001")
29
30         resp, err := shell.PublishWithDetails(examplesHashForIPNS, "", time.Second, time.Second, false)
31         if err != nil {
32                 t.Fatal(err)
33         }
34
35         if resp.Value != examplesHashForIPNS {
36                 t.Fatalf(fmt.Sprintf("Expected to receive %s but got %s", examplesHash, resp.Value))
37         }
38 }