refactor(tracex): convert to unit testing (#781)
The exercise already allowed me to notice issues such as fields not being properly initialized by savers. This is one of the last steps before moving tracex away from the internal/netx package and into the internal package. See https://github.com/ooni/probe/issues/2121
This commit is contained in:
parent
6212daa54a
commit
d397036073
17 changed files with 1674 additions and 1111 deletions
|
|
@ -119,7 +119,7 @@ func TestConfigurerNewConfigurationResolverDNSOverHTTPSPowerdns(t *testing.T) {
|
|||
if !ok {
|
||||
t.Fatal("not the resolver we expected")
|
||||
}
|
||||
stxp, ok := sr.Txp.(*tracex.SaverDNSTransport)
|
||||
stxp, ok := sr.Txp.(*tracex.DNSTransportSaver)
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
|
|
@ -195,7 +195,7 @@ func TestConfigurerNewConfigurationResolverDNSOverHTTPSGoogle(t *testing.T) {
|
|||
if !ok {
|
||||
t.Fatal("not the resolver we expected")
|
||||
}
|
||||
stxp, ok := sr.Txp.(*tracex.SaverDNSTransport)
|
||||
stxp, ok := sr.Txp.(*tracex.DNSTransportSaver)
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
|
|
@ -271,7 +271,7 @@ func TestConfigurerNewConfigurationResolverDNSOverHTTPSCloudflare(t *testing.T)
|
|||
if !ok {
|
||||
t.Fatal("not the resolver we expected")
|
||||
}
|
||||
stxp, ok := sr.Txp.(*tracex.SaverDNSTransport)
|
||||
stxp, ok := sr.Txp.(*tracex.DNSTransportSaver)
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
|
|
@ -347,7 +347,7 @@ func TestConfigurerNewConfigurationResolverUDP(t *testing.T) {
|
|||
if !ok {
|
||||
t.Fatal("not the resolver we expected")
|
||||
}
|
||||
stxp, ok := sr.Txp.(*tracex.SaverDNSTransport)
|
||||
stxp, ok := sr.Txp.(*tracex.DNSTransportSaver)
|
||||
if !ok {
|
||||
t.Fatal("not the DNS transport we expected")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue