From 1406ed2098e1a48fd207c3d1ce8ab94c613bff33 Mon Sep 17 00:00:00 2001 From: Naomi Kramer Date: Wed, 17 Jul 2024 10:25:50 -0400 Subject: [PATCH] Fix viewer test --- database/threat_intel.go | 1 - integration_rolling/ttl_test.go | 1 - modifier/modifier.go | 1 - util/util_test.go | 1 - viewer/sidebar_test.go | 4 ++-- viewer/viewer.go | 1 - 6 files changed, 2 insertions(+), 7 deletions(-) diff --git a/database/threat_intel.go b/database/threat_intel.go index af44c8d..9ce8393 100644 --- a/database/threat_intel.go +++ b/database/threat_intel.go @@ -391,7 +391,6 @@ func parseFeedEntries(feedHash util.FixedString, feed io.ReadCloser, writeChan c for { line, readErr := reader.ReadString('\n') - // fmt.Println(line) // if there is an error reading the line and its not the end of the file, return the error if readErr != nil && readErr != io.EOF { diff --git a/integration_rolling/ttl_test.go b/integration_rolling/ttl_test.go index f53d07a..74cfe86 100644 --- a/integration_rolling/ttl_test.go +++ b/integration_rolling/ttl_test.go @@ -378,7 +378,6 @@ func optimizeMetaDBTables(t *testing.T, db *database.DB, updateTime func(time.Du require.NoError(t, err) err = db.Conn.Exec(ctx, `OPTIMIZE TABLE metadatabase.{table:Identifier} FINAL`) require.NoError(t, err, "optimizing %s.%s should not fail", "metadatabase", table) - // fmt.Println("OPTIMIZED", table) } } func verifyTables(t *testing.T, db *database.DB, importTime time.Time, expect26hEmpty, expect2wEmpty, expect6mEmpty, expect1YrEmpty bool) { diff --git a/modifier/modifier.go b/modifier/modifier.go index f348f3a..daf8fa7 100644 --- a/modifier/modifier.go +++ b/modifier/modifier.go @@ -207,7 +207,6 @@ func (modifier *Modifier) detectMIMETypeMismatch(ctx context.Context) error { rows.Close() return ctx.Err() default: - // fmt.Println("hi") var res analysis.ThreatMixtape if err := rows.ScanStruct(&res); err != nil { // return error and cancel all uconn analysis diff --git a/util/util_test.go b/util/util_test.go index a6062dc..76e54c5 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -943,7 +943,6 @@ func TestValidateTimestamp(t *testing.T) { func TestParseRelativePath(t *testing.T) { home, err := os.UserHomeDir() require.NoError(t, err) - fmt.Println("home: ", home) workingDir, err := os.Getwd() require.NoError(t, err) diff --git a/viewer/sidebar_test.go b/viewer/sidebar_test.go index 53fcc90..349eebb 100644 --- a/viewer/sidebar_test.go +++ b/viewer/sidebar_test.go @@ -119,7 +119,7 @@ func (s *ViewerTestSuite) TestSidebarUpdating() { items := m.List.Rows.Items() // get selected row - selectedRow, ok := items[selectedIndex].(viewer.Item) + selectedRow, ok := items[selectedIndex].(*viewer.Item) require.True(t, ok, "casting item to Item should not return an error") // check the sidebar data @@ -135,7 +135,7 @@ func (s *ViewerTestSuite) TestSidebarUpdating() { } // get the selected row after scrolling - selectedRow, ok = items[m.List.Rows.Index()].(viewer.Item) + selectedRow, ok = items[m.List.Rows.Index()].(*viewer.Item) require.True(t, ok, "casting item to Item should not return an error") // check the sidebar data diff --git a/viewer/viewer.go b/viewer/viewer.go index 8353e19..ae1fb28 100644 --- a/viewer/viewer.go +++ b/viewer/viewer.go @@ -107,7 +107,6 @@ func NewModel(maxTimestamp, minTimestamp time.Time, useCurrentTime bool, db *dat // set sidebar data to whichever item is selected in the list tmp := dataList.Rows.Items()[dataList.Rows.Index()] data, ok := tmp.(*Item) - fmt.Println(data, tmp) if !ok { return nil, fmt.Errorf("error setting sidebar data")