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

Function TestPeerStoreGetByEmail

backend/wireguard/peer_store_test.go:17–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15}
16
17func TestPeerStoreGetByEmail(t *testing.T) {
18 ps := mustPeerStoreWithPeers(t,
19 mustPeerInfo("user@example.com", "testkey", []string{"10.0.0.2/32"}),
20 )
21
22 peer := ps.GetByEmail("user@example.com")
23 if peer == nil {
24 t.Fatalf("Expected peer to be returned")
25 }
26
27 if peer.Email != "user@example.com" {
28 t.Errorf("Expected email 'user@example.com', got: %s", peer.Email)
29 }
30}
31
32func TestPeerStoreGetPeerByKey(t *testing.T) {
33 ps := mustPeerStoreWithPeers(t,

Callers

nothing calls this directly

Calls 3

mustPeerStoreWithPeersFunction · 0.85
mustPeerInfoFunction · 0.85
GetByEmailMethod · 0.80

Tested by

no test coverage detected