Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package models
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestDBCCollection_AddVersion(t *testing.T) {
hash := "abcdef1234562"
dbc := &DBCVersion{
diagnosticFlags: map[int]map[string]float64{},
state: map[int]CANMessageInterface{},
}
col := DBCCollection{}
col.AddVersion(hash, dbc)
d, err := col.Get(hash)
assert.Equal(t, dbc, d)
assert.Equal(t, nil, err)
hList := col.GetHashesList()
assert.Equal(t, []string{hash}, hList)
oKey, err := col.GetOrigKey(GetShortKey(hash))
assert.Equal(t, hash, oKey)
assert.Equal(t, nil, err)
}