Files
openlan/pkg/switch/switch_test.go
2022-11-19 11:59:53 +08:00

24 lines
478 B
Go
Executable File

package _switch
import (
"fmt"
"github.com/luscis/openlan/pkg/cache"
"github.com/stretchr/testify/assert"
"testing"
)
func TestSwitch_LoadPass(t *testing.T) {
sw := &Switch{}
cache.User.SetFile("../../.password.no")
sw.LoadPass()
cache.User.SetFile("../../packaging/resource/password.example")
sw.LoadPass()
for user := range cache.User.List() {
if user == nil {
break
}
fmt.Printf("%v\n", user)
}
assert.Equal(t, 2, cache.User.Users.Len(), "notEqual")
}