mirror of
https://github.com/luscis/openlan.git
synced 2025-10-16 14:00:42 +08:00
clone from danieldin95
This commit is contained in:
21
pkg/switch/switch_test.go
Executable file
21
pkg/switch/switch_test.go
Executable file
@@ -0,0 +1,21 @@
|
||||
package _switch
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/luscis/openlan/pkg/cache"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSwitch_LoadPass(t *testing.T) {
|
||||
sw := &Switch{}
|
||||
sw.LoadPass("../../.password.no")
|
||||
sw.LoadPass("../../packaging/resource/password.example")
|
||||
for user := range cache.User.List() {
|
||||
if user == nil {
|
||||
break
|
||||
}
|
||||
fmt.Printf("%v\n", user)
|
||||
}
|
||||
assert.Equal(t, 2, cache.User.Users.Len(), "notEqual")
|
||||
}
|
Reference in New Issue
Block a user