refactor(netxlite): make sure we always use netxmocks (#399)
* refactor(netxlite): make sure we always use netmocks While there, improve logging and make sure we test 100% of the package with unit tests only. (We don't need to have integration testing in this package because it's fairly simple/obvious.) Part of https://github.com/ooni/probe/issues/1505 * further improve logs
This commit is contained in:
parent
c5dd9a68f1
commit
b8428b302f
8 changed files with 124 additions and 79 deletions
|
|
@ -16,17 +16,17 @@ type Resolver struct {
|
|||
MockAddress func() string
|
||||
}
|
||||
|
||||
// LookupHost implements Resolver.LookupHost.
|
||||
// LookupHost calls MockLookupHost.
|
||||
func (r *Resolver) LookupHost(ctx context.Context, domain string) ([]string, error) {
|
||||
return r.MockLookupHost(ctx, domain)
|
||||
}
|
||||
|
||||
// Address implements Resolver.Address.
|
||||
// Address calls MockAddress.
|
||||
func (r *Resolver) Address() string {
|
||||
return r.MockAddress()
|
||||
}
|
||||
|
||||
// Network implements Resolver.Network.
|
||||
// Network calls MockNetwork.
|
||||
func (r *Resolver) Network() string {
|
||||
return r.MockNetwork()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue