This repository has been archived by the owner on Feb 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional publish function for more fine grained control of IPNS…
… record publishing (#91)
- Loading branch information
Showing
3 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters