MCPcopy Create free account
hub / github.com/clouditor/clouditor / TestNewStorage

Function TestNewStorage

persistence/inmemory/inmemory_test.go:14–29  ·  view source on GitHub ↗

TestNewStorage is a simple test for NewStorage. If we implement in-memory our own, add more (table) tests

(t *testing.T)

Source from the content-addressed store, hash-verified

12
13// TestNewStorage is a simple test for NewStorage. If we implement in-memory our own, add more (table) tests
14func TestNewStorage(t *testing.T) {
15 s, err := NewStorage()
16 assert.NoError(t, err)
17
18 // Test to create new certification target
19 userInput := orchestratortest.NewCertificationTarget()
20 err = s.Create(userInput)
21 assert.NoError(t, err)
22
23 // Test if we get same user via its name
24 userOutput := &orchestrator.CertificationTarget{}
25 err = s.Get(userOutput, "name = ?", testdata.MockCertificationTargetName1)
26 assert.NoError(t, err)
27 assert.NoError(t, api.Validate(userOutput))
28 assert.Equal(t, userInput, userOutput)
29}

Callers

nothing calls this directly

Calls 6

CreateMethod · 0.95
GetMethod · 0.95
NewCertificationTargetFunction · 0.92
ValidateFunction · 0.92
EqualFunction · 0.92
NewStorageFunction · 0.70

Tested by

no test coverage detected