MCPcopy Create free account
hub / github.com/PasarGuard/node / TestSyncUserRejectsNilUser

Function TestSyncUserRejectsNilUser

backend/wireguard/user_sync_test.go:14–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestSyncUserRejectsNilUser(t *testing.T) {
15 wg := &WireGuard{state: lifecycleRunning}
16
17 err := wg.SyncUser(context.Background(), nil)
18 if err == nil {
19 t.Fatal("expected SyncUser to fail for nil user")
20 }
21 if !strings.Contains(err.Error(), "user is nil") {
22 t.Fatalf("unexpected error: %v", err)
23 }
24}
25
26func TestSyncUserRejectsUnparsableStoredPeer(t *testing.T) {
27 cfg, err := NewConfig(`{

Callers

nothing calls this directly

Calls 2

SyncUserMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected