MCPcopy Index your code
hub / github.com/gavv/httpexpect / TestEnvironment_Basic

Function TestEnvironment_Basic

environment_test.go:52–71  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

50}
51
52func TestEnvironment_Basic(t *testing.T) {
53 env := newEnvironment(newMockChain(t))
54
55 assert.False(t, env.Has("good_key"))
56 env.chain.assert(t, success)
57
58 env.Put("good_key", 123)
59 env.chain.assert(t, success)
60
61 assert.True(t, env.Has("good_key"))
62 assert.NotNil(t, env.Get("good_key"))
63 assert.Equal(t, 123, env.Get("good_key").(int))
64 env.chain.assert(t, success)
65
66 assert.False(t, env.Has("bad_key"))
67 env.chain.assert(t, success)
68
69 assert.Nil(t, env.Get("bad_key"))
70 env.chain.assert(t, failure)
71}
72
73func TestEnvironment_Delete(t *testing.T) {
74 env := newEnvironment(newMockChain(t))

Callers

nothing calls this directly

Calls 9

newEnvironmentFunction · 0.85
newMockChainFunction · 0.85
FalseMethod · 0.80
HasMethod · 0.80
assertMethod · 0.80
PutMethod · 0.80
TrueMethod · 0.80
GetMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…