refactor: move tunnel pkg down one level (#358)
* refactor: move tunnel pkg down one level While there, reduce unnecessary dependency on external packages. * file I forgot to commit
This commit is contained in:
parent
39aec6677d
commit
3cb6c7c6fb
21 changed files with 69 additions and 65 deletions
36
internal/tunnel/config_test.go
Normal file
36
internal/tunnel/config_test.go
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package tunnel
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/apex/log"
|
||||
)
|
||||
|
||||
func TestConfigLoggerDefault(t *testing.T) {
|
||||
config := &Config{}
|
||||
if config.logger() != defaultLogger {
|
||||
t.Fatal("not the logger we expected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigLoggerCustom(t *testing.T) {
|
||||
config := &Config{Logger: log.Log}
|
||||
if config.logger() != log.Log {
|
||||
t.Fatal("not the logger we expected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTorBinaryNotSet(t *testing.T) {
|
||||
config := &Config{}
|
||||
if config.torBinary() != "tor" {
|
||||
t.Fatal("not the result we expected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTorBinarySet(t *testing.T) {
|
||||
path := "/usr/local/bin/tor"
|
||||
config := &Config{TorBinary: path}
|
||||
if config.torBinary() != path {
|
||||
t.Fatal("not the result we expected")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue