1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 19:44:01 +08:00
Files
kubo/core/pathresolver_test.go
Jeromy 4a78a9729d remove testing imports from non testing code
rename bserv mock to mock_test

swap out testing.T for an interface
2015-05-31 15:41:59 -07:00

28 lines
647 B
Go

package core_test
import (
"testing"
core "github.com/ipfs/go-ipfs/core"
coremock "github.com/ipfs/go-ipfs/core/mock"
path "github.com/ipfs/go-ipfs/path"
)
func TestResolveNoComponents(t *testing.T) {
n, err := coremock.NewMockNode()
if n == nil || err != nil {
t.Fatal("Should have constructed a mock node", err)
}
_, err = core.Resolve(n.Context(), n, path.Path("/ipns/"))
if err != path.ErrNoComponents {
t.Fatal("Should error with no components (/ipns/).", err)
}
_, err = core.Resolve(n.Context(), n, path.Path("/ipfs/"))
if err != path.ErrNoComponents {
t.Fatal("Should error with no components (/ipfs/).", err)
}
}