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

Function TestRuntimeStore_SessionUpdate

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

Source from the content-addressed store, hash-verified

32}
33
34func TestRuntimeStore_SessionUpdate(t *testing.T) {
35 // Use a separate store for this test to avoid race conditions
36 testStore := NewRuntimeStore(NewDefaultRuntimeConfig())
37 testValue := make(map[interface{}]interface{})
38 testValue["foo"] = "bar"
39 testValue["kak"] = "lal"
40
41 testState := NewSessionState(testStore, "session_read", testValue)
42 testStore.SessionUpdate(testState)
43
44 fmt.Println("-------------before update session state------------")
45 state, _ := testStore.SessionRead("session_read")
46 fmt.Printf("session state session_read: %+v \n ", state)
47
48 testState.values["foo"] = "newbar"
49 testStore.SessionUpdate(testState)
50
51 state, _ = testStore.SessionRead("session_read")
52 fmt.Println("-------------after update session state------------")
53 fmt.Printf("session state session_read: %+v \n ", state)
54}
55
56func TestNewRuntimeStore_SessionUpdate_StateNotExist(t *testing.T) {
57 // Use a separate store for this test

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected