srijeet0406 commented on code in PR #7406:
URL: https://github.com/apache/trafficcontrol/pull/7406#discussion_r1145672121


##########
traffic_ops/traffic_ops_golang/server/servers_test.go:
##########
@@ -722,3 +723,387 @@ func (s SortableServers) Swap(i, j int) {
 func (s SortableServers) Less(i, j int) bool {
        return s[i].HostName < s[j].HostName
 }
+
+func TestUpdateStatusLastUpdatedTime(t *testing.T) {
+       mockDB, mock, err := sqlmock.New()
+       if err != nil {
+               t.Fatalf("an error '%v' was not expected when opening a stub 
database connection", err)
+       }
+       defer mockDB.Close()
+
+       db := sqlx.NewDb(mockDB, "sqlmock")
+       defer db.Close()
+
+       lastUpdated := time.Now()
+       mock.ExpectBegin()
+       mock.ExpectExec("UPDATE").WithArgs(lastUpdated, 
1).WillReturnResult(sqlmock.NewResult(1, 1))
+       mock.ExpectCommit()
+
+       _, sysErr, code := updateStatusLastUpdatedTime(1, &lastUpdated, 
db.MustBegin().Tx)

Review Comment:
   Is there a reason why we're not checking user error here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to