Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-merkledag
Commits
173940b4
Commit
173940b4
authored
May 17, 2016
by
Juan Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address CR - use dstest.Mock
License: MIT Signed-off-by:
Juan Benet
<
juan@benet.ai
>
parent
b26887e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
8 deletions
+1
-8
merkledag_test.go
merkledag_test.go
+1
-8
No files found.
merkledag_test.go
View file @
173940b4
...
@@ -32,13 +32,6 @@ type dagservAndPinner struct {
...
@@ -32,13 +32,6 @@ type dagservAndPinner struct {
mp
pin
.
Pinner
mp
pin
.
Pinner
}
}
func
getDagserv
(
t
*
testing
.
T
)
DAGService
{
db
:=
dssync
.
MutexWrap
(
ds
.
NewMapDatastore
())
bs
:=
bstore
.
NewBlockstore
(
db
)
blockserv
:=
bserv
.
New
(
bs
,
offline
.
Exchange
(
bs
))
return
NewDAGService
(
blockserv
)
}
func
getDagservAndPinner
(
t
*
testing
.
T
)
dagservAndPinner
{
func
getDagservAndPinner
(
t
*
testing
.
T
)
dagservAndPinner
{
db
:=
dssync
.
MutexWrap
(
ds
.
NewMapDatastore
())
db
:=
dssync
.
MutexWrap
(
ds
.
NewMapDatastore
())
bs
:=
bstore
.
NewBlockstore
(
db
)
bs
:=
bstore
.
NewBlockstore
(
db
)
...
@@ -253,7 +246,7 @@ func assertCanGet(t *testing.T, ds DAGService, n *Node) {
...
@@ -253,7 +246,7 @@ func assertCanGet(t *testing.T, ds DAGService, n *Node) {
}
}
func
TestEmptyKey
(
t
*
testing
.
T
)
{
func
TestEmptyKey
(
t
*
testing
.
T
)
{
ds
:=
getDagserv
(
t
)
ds
:=
dstest
.
Mock
(
)
_
,
err
:=
ds
.
Get
(
context
.
Background
(),
key
.
Key
(
""
))
_
,
err
:=
ds
.
Get
(
context
.
Background
(),
key
.
Key
(
""
))
if
err
!=
ErrNotFound
{
if
err
!=
ErrNotFound
{
t
.
Error
(
"dag service should error when key is nil"
,
err
)
t
.
Error
(
"dag service should error when key is nil"
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment