Skip to content

Commit

Permalink
fix: timetype in toString
Browse files Browse the repository at this point in the history
  • Loading branch information
rupozzi committed May 31, 2022
1 parent 0ed258e commit 43d9164
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/DIRAC/Core/Utilities/TimeUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def toString(myDate=None):
elif isinstance(myDate, datetime.date):
return str(myDate)

elif isinstance(myDate, datetime.timedelta):
elif isinstance(myDate, datetime.time):
return "%02d:%02d:%02d.%06d" % (
myDate.days * 24 + myDate.seconds / 3600,
myDate.seconds % 3600 / 60,
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/Core/Test_MySQLDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ def test_getDistinctAttributeValues(name, fields, requiredFields, values, table,
),
(table, allFields, genVal2(), name, {"older": "UTC_TIMESTAMP()", "timeStamp": "Time"}, 2, True),
(table, allFields, genVal2(), name, {"newer": "UTC_TIMESTAMP()", "timeStamp": "Time"}, 0, True),
(table, allFields, genVal2(), name, {"older": TimeUtilities.toString, "timeStamp": "Time"}, 2, True),
(table, allFields, genVal2(), name, {"newer": TimeUtilities.toString, "timeStamp": "Time"}, 0, True),
(table, allFields, genVal2(), name, {"older": TimeUtilities.toString, "timeStamp": "Time"}, 0, True),
(table, allFields, genVal2(), name, {"newer": TimeUtilities.toString, "timeStamp": "Time"}, 2, True),
],
)
def test_getFields(table, reqFields, values, name, args, expected, isExpectedCount):
Expand Down

0 comments on commit 43d9164

Please sign in to comment.