mirror of https://github.com/poanetwork/gecko.git
Merge pull request #57 from moreati/snow-networking-test
snow: Add test for Sender.Context()
This commit is contained in:
commit
fef453405c
|
@ -4,6 +4,7 @@
|
||||||
package sender
|
package sender
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"reflect"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -17,6 +18,20 @@ import (
|
||||||
"github.com/ava-labs/gecko/utils/logging"
|
"github.com/ava-labs/gecko/utils/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestSenderContext(t *testing.T) {
|
||||||
|
context := snow.DefaultContextTest()
|
||||||
|
sender := Sender{}
|
||||||
|
sender.Initialize(
|
||||||
|
context,
|
||||||
|
&ExternalSenderTest{},
|
||||||
|
&router.ChainRouter{},
|
||||||
|
&timeout.Manager{},
|
||||||
|
)
|
||||||
|
if res := sender.Context(); !reflect.DeepEqual(res, context) {
|
||||||
|
t.Fatalf("Got %#v, expected %#v", res, context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestTimeout(t *testing.T) {
|
func TestTimeout(t *testing.T) {
|
||||||
tm := timeout.Manager{}
|
tm := timeout.Manager{}
|
||||||
tm.Initialize(time.Millisecond)
|
tm.Initialize(time.Millisecond)
|
||||||
|
|
Loading…
Reference in New Issue