Merged in feature/docinitialisation (pull request #41)
Queuing Changes and Cfg Testing * staarting * staarting * startedpush * note * save * mocking * removederrs * fixtests * cleanuperrs * newenvsetup * preppingtests * queue * mmovetocfgpassunittests * sortoutconfig * passinginteg * deps * fixtests
This commit is contained in:
@@ -20,7 +20,7 @@ func TestParseDBCollectorQuery(t *testing.T) {
|
||||
Queryversion: 1,
|
||||
}
|
||||
value, err := resultprocessor.ParseDBCollectorQuery(&dbResult)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, uuid.Nil, value.ID)
|
||||
assert.Nil(t, value.RequiredQueryIDs)
|
||||
assert.Equal(t, int32(1), value.Version)
|
||||
@@ -34,7 +34,7 @@ func TestParseDBCollectorQuery(t *testing.T) {
|
||||
func TestParseDBNullType(t *testing.T) {
|
||||
qType := repository.NullQuerytype{Valid: true, Querytype: repository.QuerytypeJsonExtractor}
|
||||
value, err := resultprocessor.ParseDBNullType(qType)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, resultprocessor.Type(resultprocessor.TypeJsonExtractor), value)
|
||||
|
||||
qType = repository.NullQuerytype{}
|
||||
@@ -49,19 +49,19 @@ func TestParseDBNullType(t *testing.T) {
|
||||
func TestParseDBType(t *testing.T) {
|
||||
qType := repository.QuerytypeJsonExtractor
|
||||
value, err := resultprocessor.ParseDBType(qType)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, resultprocessor.Type(resultprocessor.TypeJsonExtractor), value)
|
||||
|
||||
qType = repository.QuerytypeContextFull
|
||||
value, err = resultprocessor.ParseDBType(qType)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, resultprocessor.Type(resultprocessor.TypeContextFull), value)
|
||||
}
|
||||
|
||||
func TestToDBQueryType(t *testing.T) {
|
||||
dbQueryType := resultprocessor.Type(resultprocessor.TypeJsonExtractor)
|
||||
value, err := resultprocessor.ToDBQueryType(dbQueryType)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, repository.Querytype(repository.QuerytypeJsonExtractor), value)
|
||||
|
||||
dbQueryType = resultprocessor.Type(-1)
|
||||
@@ -70,7 +70,7 @@ func TestToDBQueryType(t *testing.T) {
|
||||
|
||||
dbQueryType = resultprocessor.Type(resultprocessor.TypeContextFull)
|
||||
value, err = resultprocessor.ToDBQueryType(dbQueryType)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, repository.Querytype(repository.QuerytypeContextFull), value)
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ func TestToDBQueryTypeArray(t *testing.T) {
|
||||
resultprocessor.TypeContextFull,
|
||||
}
|
||||
value, err := resultprocessor.ToDBQueryTypeArray(inArr)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, []repository.Querytype{
|
||||
repository.QuerytypeJsonExtractor,
|
||||
repository.QuerytypeContextFull,
|
||||
@@ -96,7 +96,7 @@ func TestToDBQueryTypeArray(t *testing.T) {
|
||||
func TestToDBNullQueryType(t *testing.T) {
|
||||
dbQueryType := resultprocessor.Type(resultprocessor.TypeJsonExtractor)
|
||||
value, err := resultprocessor.ToDBNullQueryType(dbQueryType)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, repository.NullQuerytype{Valid: true, Querytype: repository.QuerytypeJsonExtractor}, value)
|
||||
|
||||
dbQueryType = resultprocessor.Type(-1)
|
||||
@@ -105,14 +105,14 @@ func TestToDBNullQueryType(t *testing.T) {
|
||||
|
||||
dbQueryType = resultprocessor.Type(resultprocessor.TypeContextFull)
|
||||
value, err = resultprocessor.ToDBNullQueryType(dbQueryType)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, repository.NullQuerytype{Valid: true, Querytype: repository.QuerytypeContextFull}, value)
|
||||
}
|
||||
|
||||
func TestParseFullQuery(t *testing.T) {
|
||||
var q *repository.Fullactivequery
|
||||
out, err := resultprocessor.ParseFullQuery(q)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.Nil(t, out)
|
||||
|
||||
q = &repository.Fullactivequery{
|
||||
@@ -123,7 +123,7 @@ func TestParseFullQuery(t *testing.T) {
|
||||
}
|
||||
|
||||
out, err = resultprocessor.ParseFullQuery(q)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualExportedValues(t, &resultprocessor.Query{
|
||||
ID: database.MustToUUID(q.ID),
|
||||
Type: resultprocessor.TypeContextFull,
|
||||
@@ -139,7 +139,7 @@ func TestParseFullQuery(t *testing.T) {
|
||||
}
|
||||
|
||||
out, err = resultprocessor.ParseFullQuery(q)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualExportedValues(t, &resultprocessor.Query{
|
||||
ID: database.MustToUUID(q.ID),
|
||||
Type: resultprocessor.TypeContextFull,
|
||||
@@ -158,7 +158,7 @@ func TestParseFullQuery(t *testing.T) {
|
||||
}
|
||||
|
||||
out, err = resultprocessor.ParseFullQuery(q)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
cfg := "hello"
|
||||
assert.EqualExportedValues(t, &resultprocessor.Query{
|
||||
ID: database.MustToUUID(q.ID),
|
||||
@@ -172,7 +172,7 @@ func TestParseFullQuery(t *testing.T) {
|
||||
func TestParseFullQueryArray(t *testing.T) {
|
||||
var q []*repository.Fullactivequery
|
||||
out, err := resultprocessor.ParseFullQueryArray(q)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.ElementsMatch(t, []*resultprocessor.Query{}, out)
|
||||
|
||||
q = []*repository.Fullactivequery{
|
||||
@@ -185,7 +185,7 @@ func TestParseFullQueryArray(t *testing.T) {
|
||||
}
|
||||
|
||||
out, err = resultprocessor.ParseFullQueryArray(q)
|
||||
assert.Nil(t, err)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualExportedValues(t, []*resultprocessor.Query{
|
||||
{
|
||||
ID: database.MustToUUID(q[0].ID),
|
||||
|
||||
Reference in New Issue
Block a user