Cameradar 3.0.0: Uses ullaakut/nmap, runs faster, removed legacy code (#188)
Unit tests functional and coverage back to 100% Add more routes to dictionary, add more credentials, add default port 5554, rename cameradar logs ENV variable, improve unit test readability, remove tmp file
This commit is contained in:
committed by
GitHub
parent
878ca9f032
commit
5849898283
+35
@@ -0,0 +1,35 @@
|
||||
package mg
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDepsLogging(t *testing.T) {
|
||||
os.Setenv("MAGEFILE_VERBOSE", "1")
|
||||
defer os.Unsetenv("MAGEFILE_VERBOSE")
|
||||
buf := &bytes.Buffer{}
|
||||
|
||||
defaultLogger := logger
|
||||
logger = log.New(buf, "", 0)
|
||||
defer func() { logger = defaultLogger }()
|
||||
|
||||
foo()
|
||||
|
||||
if strings.Count(buf.String(), "Running dependency: github.com/magefile/mage/mg.baz") != 1 {
|
||||
t.Fatalf("expected one baz to be logged, but got\n%s", buf)
|
||||
}
|
||||
}
|
||||
|
||||
func foo() {
|
||||
Deps(bar, baz)
|
||||
}
|
||||
|
||||
func bar() {
|
||||
Deps(baz)
|
||||
}
|
||||
|
||||
func baz() {}
|
||||
Reference in New Issue
Block a user