fix(session): make sure tunnel code is tested (#301)
* fix(session): make sure tunnel code is tested Part of https://github.com/ooni/probe/issues/985 * fix: add missing TunnelDir for correctness
This commit is contained in:
parent
8b92037ae3
commit
7172e750dd
4 changed files with 69 additions and 4 deletions
20
internal/engine/session_nopsiphon_test.go
Normal file
20
internal/engine/session_nopsiphon_test.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// +build !ooni_psiphon_config
|
||||
|
||||
package engine
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEarlySessionNoPsiphonFetchPsiphonConfig(t *testing.T) {
|
||||
s := &sessionTunnelEarlySession{}
|
||||
out, err := s.FetchPsiphonConfig(context.Background())
|
||||
if !errors.Is(err, errPsiphonNoEmbeddedConfig) {
|
||||
t.Fatal("not the error we expected", err)
|
||||
}
|
||||
if out != nil {
|
||||
t.Fatal("expected nil here")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue