Skip to content

Commit

Permalink
fix(routing): use explicit opts in test
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed May 3, 2023
1 parent ee04895 commit b813722
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions coreiface/tests/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@ func (tp *TestSuite) TestRouting(t *testing.T) {
t.Run("TestRoutingPutOffline", tp.TestRoutingPutOffline)
}

func (tp *TestSuite) testRoutingPublishKey(t *testing.T, ctx context.Context, api iface.CoreAPI) iface.IpnsEntry {
func (tp *TestSuite) testRoutingPublishKey(t *testing.T, ctx context.Context, api iface.CoreAPI, opts ...options.NamePublishOption) iface.IpnsEntry {
p, err := addTestObject(ctx, api)
if err != nil {
t.Fatal(err)
}

// TODO: make sure we are fine with that implicit allow offline
opts := []options.NamePublishOption{
options.Name.AllowOffline(true),
}

entry, err := api.Name().Publish(ctx, p, opts...)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -108,7 +103,7 @@ func (tp *TestSuite) TestRoutingPutOffline(t *testing.T) {
t.Fatal(err)
}

ipnsEntry := tp.testRoutingPublishKey(t, ctx, apis[0])
ipnsEntry := tp.testRoutingPublishKey(t, ctx, apis[0], options.Name.AllowOffline(true))
data, err := apis[0].Routing().Get(ctx, "/ipns/"+ipnsEntry.Name())
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit b813722

Please sign in to comment.