MCPcopy Create free account
hub / github.com/devfeel/dotweb / TestRuntimeStore_SessionRead

Function TestRuntimeStore_SessionRead

session/store_runtime_test.go:76–95  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestRuntimeStore_SessionRead(t *testing.T) {
77 // Use a separate store for this test
78 testStore := NewRuntimeStore(NewDefaultRuntimeConfig())
79 testValue := make(map[interface{}]interface{})
80 testValue["foo"] = "bar"
81 testValue["kak"] = "lal"
82
83 testStore.SessionUpdate(NewSessionState(testStore, "session_read", testValue))
84 testStore.SessionUpdate(NewSessionState(testStore, "session_read_1", testValue))
85 testStore.SessionUpdate(NewSessionState(testStore, "session_read_2", testValue))
86
87 fmt.Printf("runtime_store: %+v \n", *testStore)
88 read, _ := testStore.SessionRead("session_read")
89 if read == nil {
90 fmt.Println("cannot find sessionId")
91 return
92 }
93 fmt.Println("start read : ")
94 fmt.Printf("sessionid : %v , values : %v \n", read.SessionID(), read.values)
95}
96
97func TestRuntimeStore_SessionExist(t *testing.T) {
98 // Use a separate store for this test

Callers

nothing calls this directly

Calls 6

SessionUpdateMethod · 0.95
SessionReadMethod · 0.95
NewRuntimeStoreFunction · 0.85
NewDefaultRuntimeConfigFunction · 0.85
NewSessionStateFunction · 0.85
SessionIDMethod · 0.65

Tested by

no test coverage detected