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-blockservice
Commits
bb4eca86
Commit
bb4eca86
authored
May 20, 2015
by
Jeromy
Committed by
Juan Batiz-Benet
May 31, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove testing imports from non testing code
rename bserv mock to mock_test swap out testing.T for an interface
parent
7b2d310c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
mock.go
mock.go
+5
-3
No files found.
mock.go
View file @
bb4eca86
package
blockservice
import
(
"testing"
bitswap
"github.com/ipfs/go-ipfs/exchange/bitswap"
tn
"github.com/ipfs/go-ipfs/exchange/bitswap/testnet"
mockrouting
"github.com/ipfs/go-ipfs/routing/mock"
delay
"github.com/ipfs/go-ipfs/thirdparty/delay"
)
type
fataler
interface
{
Fatal
(
args
...
interface
{})
}
// Mocks returns |n| connected mock Blockservices
func
Mocks
(
t
*
testing
.
T
,
n
int
)
[]
*
BlockService
{
func
Mocks
(
t
fataler
,
n
int
)
[]
*
BlockService
{
net
:=
tn
.
VirtualNetwork
(
mockrouting
.
NewServer
(),
delay
.
Fixed
(
0
))
sg
:=
bitswap
.
NewTestSessionGenerator
(
net
)
...
...
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