Пример #1
0
// Signature: process(modelName string, data []map[string]interface{})
func TestProcess(t *testing.T) {

	u := uuidimported.New()

	fiddler.Init(u)
	coral.Init(u)

	modelName := "comment"
	var data []map[string]interface{}
	reportOnFailedRecords := false

	AddOptions(999, 0, "", "", "", false, reportOnFailedRecords, "", 5)

	process(modelName, data)

	// check data is sent to pillar with the right transformations
}
Пример #2
0
// Init initialize the packages that are going to be used by sponge
func Init(u string) error {

	uuid = u
	var err error

	// Initialize the source
	foreignSource, err := source.Init(uuid)
	if err != nil {
		log.Error(uuid, "sponge.import", err, "Initialization of Source")
		return err
	}
	dbsource, err = source.New(foreignSource) // To Do. 1. Needs to ensure maximum rate limit is not reached
	if err != nil {
		log.Error(uuid, "sponge.import", err, "Connect to external Database")
		return err
	}

	fiddler.Init(uuid)
	coral.Init(uuid)

	return err
}