mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
12f8c0b671
This PR reorganizes a bunch of the files in datastore such that all datastore implementations are consistently broken up into multiple files. Additionally, the datastore tests follow a similar pattern and can easily be applied to any complete datastore implementation.
36 lines
698 B
Go
36 lines
698 B
Go
package datastore
|
|
|
|
import (
|
|
"reflect"
|
|
"runtime"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/kolide/kolide-ose/server/kolide"
|
|
)
|
|
|
|
func functionName(f func(*testing.T, kolide.Datastore)) string {
|
|
fullName := runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()
|
|
elements := strings.Split(fullName, ".")
|
|
return elements[len(elements)-1]
|
|
|
|
}
|
|
|
|
var testFunctions = [...]func(*testing.T, kolide.Datastore){
|
|
testOrgInfo,
|
|
testCreateInvite,
|
|
testDeleteQuery,
|
|
testSaveQuery,
|
|
testDeletePack,
|
|
testAddAndRemoveQueryFromPack,
|
|
testEnrollHost,
|
|
testAuthenticateHost,
|
|
testLabels,
|
|
testManagingLabelsOnPacks,
|
|
testPasswordResetRequests,
|
|
testCreateUser,
|
|
testSaveUser,
|
|
testUserByID,
|
|
testPasswordResetRequests,
|
|
}
|