imddevaraj commented on code in PR #41527:
URL: https://github.com/apache/superset/pull/41527#discussion_r3497417633


##########
tests/unit_tests/utils/date_parser_tests.py:
##########
@@ -760,3 +760,27 @@ def 
test_datetime_eval_does_not_emit_parsedatetime_debug_logs(
         "flood production logs. Records: "
         + repr([(r.levelname, r.getMessage()) for r in parsedatetime_records])
     )
+
+
+@patch("superset.utils.date_parser.parse_human_datetime", 
mock_parse_human_datetime)
+def test_get_since_until_sub_hour_presets() -> None:
+    """Verify that sub-hour presets ('Last 5 minutes', 'Last 15 minutes',
+    'Last 30 minutes', 'Last 1 hour') resolve to the expected datetime pairs
+    when relative_end='now'."""
+    result: tuple
+
+    result = get_since_until("Last 5 minutes", relative_end="now")
+    expected = datetime(2016, 11, 7, 9, 25, 10), datetime(2016, 11, 7, 9, 30, 
10)

Review Comment:
   Pushed the changes



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to