Fix unit test failures

This commit is contained in:
Abhishek Pandey 2023-12-03 17:39:56 -08:00
parent 1d971fb2ef
commit cddb5b2d15
3 changed files with 15 additions and 17 deletions

View File

@ -956,8 +956,8 @@ func (c *Collections) processItem(
"item_is_folder", isFolder) "item_is_folder", isFolder)
if item.GetMalware() != nil { if item.GetMalware() != nil {
// TODO(pandeyabs): Fix this after we move conversion logic to the top of this // TODO(pandeyabs): Fix this after we move the ToLiteDriveItemable call
// func. // to the beginning of this func.
addtl := graph.ItemInfo(custom.ToLiteDriveItemable(item)) addtl := graph.ItemInfo(custom.ToLiteDriveItemable(item))
skip := fault.FileSkip(fault.SkipMalware, driveID, itemID, itemName, addtl) skip := fault.FileSkip(fault.SkipMalware, driveID, itemID, itemName, addtl)

View File

@ -513,17 +513,15 @@ func appendIf(a []any, k string, v *string) []any {
func ItemInfo(item custom.LiteDriveItemable) map[string]any { func ItemInfo(item custom.LiteDriveItemable) map[string]any {
m := map[string]any{} m := map[string]any{}
// TODO(pandeyabs): These fields are not available in the LiteDriveItemable creator := item.GetCreatedByUser()
// yet. We need to add them. if creator != nil {
// creator := item.GetCreatedByUser() m[fault.AddtlCreatedBy] = ptr.Val(creator.GetId())
// if creator != nil { }
// m[fault.AddtlCreatedBy] = ptr.Val(creator.GetId())
// }
// lastmodder := item.GetLastModifiedByUser() lastmodder := item.GetLastModifiedByUser()
// if lastmodder != nil { if lastmodder != nil {
// m[fault.AddtlLastModBy] = ptr.Val(lastmodder.GetId()) m[fault.AddtlLastModBy] = ptr.Val(lastmodder.GetId())
// } }
parent := item.GetParentReference() parent := item.GetParentReference()
if parent != nil { if parent != nil {
@ -540,10 +538,10 @@ func ItemInfo(item custom.LiteDriveItemable) map[string]any {
m[fault.AddtlContainerPath] = containerPath m[fault.AddtlContainerPath] = containerPath
} }
// malware := item.GetMalware() malware := item.GetMalware()
// if malware != nil { if malware != nil {
// m[fault.AddtlMalwareDesc] = ptr.Val(malware.GetDescription()) m[fault.AddtlMalwareDesc] = ptr.Val(malware.GetDescription())
// } }
return m return m
} }

View File

@ -338,7 +338,7 @@ func ToLiteDriveItemable(item models.DriveItemable) LiteDriveItemable {
return di return di
} }
func SetParentName(orig parentReferenceable, driveName string) parentReferenceable { func SetParentName(orig itemReferenceable, driveName string) itemReferenceable {
if orig == nil { if orig == nil {
return nil return nil
} }