MCPcopy Create free account
hub / github.com/git-bug/git-bug / testCredentialSerial

Function testCredentialSerial

bridge/core/auth/credential_test.go:104–124  ·  view source on GitHub ↗
(t *testing.T, original Credential)

Source from the content-addressed store, hash-verified

102}
103
104func testCredentialSerial(t *testing.T, original Credential) Credential {
105 repo := repository.NewMockRepo()
106
107 original.SetMetadata("test", "value")
108
109 assert.NotEmpty(t, original.ID().String())
110 assert.NotEmpty(t, original.Salt())
111 assert.NoError(t, Store(repo, original))
112
113 loaded, err := LoadWithId(repo, original.ID())
114 assert.NoError(t, err)
115
116 assert.Equal(t, original.ID(), loaded.ID())
117 assert.Equal(t, original.Kind(), loaded.Kind())
118 assert.Equal(t, original.Target(), loaded.Target())
119 assert.Equal(t, original.CreateTime().Unix(), loaded.CreateTime().Unix())
120 assert.Equal(t, original.Salt(), loaded.Salt())
121 assert.Equal(t, original.Metadata(), loaded.Metadata())
122
123 return loaded
124}

Callers 3

TestTokenSerialFunction · 0.85
TestLoginSerialFunction · 0.85
TestLoginPasswordSerialFunction · 0.85

Calls 11

NewMockRepoFunction · 0.92
StoreFunction · 0.85
LoadWithIdFunction · 0.85
SetMetadataMethod · 0.65
StringMethod · 0.65
IDMethod · 0.65
SaltMethod · 0.65
KindMethod · 0.65
TargetMethod · 0.65
CreateTimeMethod · 0.65
MetadataMethod · 0.65

Tested by

no test coverage detected