@@ -159,11 +159,11 @@ func CheckPackagesNamesInDB(t *testing.T, filter string, packageNames ...string)
159159 assert .Equal (t , int64 (len (packageNames )), count )
160160}
161161
162- func CheckSystemJustEvaluated (t * testing.T , inventoryID string , nIAll , nIEnh , nIBug , nISec ,
162+ func CheckSystemJustEvaluated (t * testing.T , inventoryID uuid. UUID , nIAll , nIEnh , nIBug , nISec ,
163163 nAAll , nAEnh , nABug , nASec , nInstall , nInstallable , nApplicable int ,
164164 thirdParty bool ) {
165165 var inv models.SystemInventory
166- assert .Nil (t , DB .Where ("inventory_id = ?::uuid " , inventoryID ).First (& inv ).Error )
166+ assert .Nil (t , DB .Where ("inventory_id = ?" , inventoryID ).First (& inv ).Error )
167167 var patch models.SystemPatch
168168 assert .Nil (t , DB .Where ("rh_account_id = ? AND system_id = ?" , inv .RhAccountID , inv .ID ).First (& patch ).Error )
169169 assert .NotNil (t , patch .LastEvaluation )
@@ -427,7 +427,7 @@ func GetPackageIDs(nevras ...string) []int64 {
427427 return ids
428428}
429429
430- func CreateTemplate (t * testing.T , account int , uuid string , inventoryIDs []string ) {
430+ func CreateTemplate (t * testing.T , account int , uuid string , inventoryIDs []uuid. UUID ) {
431431 template := & models.Template {
432432 TemplateBase : models.TemplateBase {
433433 RhAccountID : account , UUID : uuid , Name : uuid ,
@@ -451,7 +451,7 @@ func CreateTemplate(t *testing.T, account int, uuid string, inventoryIDs []strin
451451 SELECT id
452452 FROM system_inventory
453453 WHERE rh_account_id = ?
454- AND inventory_id = ?::uuid
454+ AND inventory_id = ?
455455 )` ,
456456 template .ID , account , account , invID ).Error
457457 assert .Nil (t , err )
@@ -477,21 +477,21 @@ func DeleteTemplate(t *testing.T, account int, templateUUID string) {
477477 assert .Nil (t , err )
478478}
479479
480- func CheckTemplateSystems (t * testing.T , account int , templateUUID string , inventoryIDs []string ) {
481- var dbInventoryIDs []string
480+ func CheckTemplateSystems (t * testing.T , account int , templateUUID string , inventoryIDs []uuid. UUID ) {
481+ var foundInventoryIDs []uuid. UUID
482482 err := DB .Table ("system_inventory si" ).Select ("si.inventory_id as id" ).
483483 Joins ("JOIN system_patch spatch ON si.id = spatch.system_id AND si.rh_account_id = spatch.rh_account_id" ).
484484 Joins ("JOIN template tp ON tp.id = spatch.template_id AND tp.rh_account_id = spatch.rh_account_id" ).
485485 Where ("si.rh_account_id = ? AND tp.uuid = ?::uuid" , account , templateUUID ).
486486 Order ("id" ).
487- Find (& dbInventoryIDs ).Error
487+ Find (& foundInventoryIDs ).Error
488488
489489 assert .Nil (t , err )
490490
491- assert .Equal (t , len (inventoryIDs ), len (dbInventoryIDs ))
492- if len (inventoryIDs ) == len (dbInventoryIDs ) {
491+ assert .Equal (t , len (inventoryIDs ), len (foundInventoryIDs ))
492+ if len (inventoryIDs ) == len (foundInventoryIDs ) {
493493 for index , inventoryID := range inventoryIDs {
494- assert .Equal (t , inventoryID , dbInventoryIDs [index ])
494+ assert .Equal (t , inventoryID , foundInventoryIDs [index ])
495495 }
496496 }
497497}
0 commit comments