2021-09-05 14:49:38 +02:00
|
|
|
//go:build !ooni_psiphon_config
|
2021-04-05 19:51:41 +02:00
|
|
|
|
|
|
|
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")
|
|
|
|
}
|
|
|
|
}
|
2021-11-19 12:40:10 +01:00
|
|
|
|
|
|
|
func TestCheckEmbeddedPsiphonConfig(t *testing.T) {
|
|
|
|
if err := CheckEmbeddedPsiphonConfig(); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|