forked from ooni/probe-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup(dslx): use model.UnderlyingNetwork for testing (ooni#1377)
Closes ooni/probe#2582
- Loading branch information
1 parent
d1fa91c
commit 6497f87
Showing
12 changed files
with
170 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package dslx | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/ooni/probe-cli/v3/internal/measurexlite" | ||
"github.com/ooni/probe-cli/v3/internal/mocks" | ||
"github.com/ooni/probe-cli/v3/internal/model" | ||
) | ||
|
||
func TestMeasurexLiteRuntime(t *testing.T) { | ||
t.Run("we can configure a custom model.MeasuringNetwork", func(t *testing.T) { | ||
netx := &mocks.MeasuringNetwork{} | ||
rt := NewRuntimeMeasurexLite(model.DiscardLogger, time.Now(), RuntimeMeasurexLiteOptionMeasuringNetwork(netx)) | ||
if rt.netx != netx { | ||
t.Fatal("did not set the measuring network") | ||
} | ||
trace := rt.NewTrace(rt.IDGenerator().Add(1), rt.ZeroTime()).(*measurexlite.Trace) | ||
if trace.Netx != netx { | ||
t.Fatal("did not set the measuring network") | ||
} | ||
}) | ||
} |
Oops, something went wrong.