test: update CHANGELOG and UnitTest for the PR
@@ -943,6 +943,23 @@ class OperatorTest(unittest2.TestCase):
"Passed test_timediff_lt with None as criteria_pattern.",
)
+ def test_timediff_lt_webui_value(self):
+ op = operators.get_operator("timediff_lt")
+ self.assertTrue(
+ op(date_utils.get_datetime_utc_now().isoformat(), "10"),
+ "Failed test_timediff_lt_webui_value.",
+ )
+
+ def test_timediff_lt_webui_value_fail(self):
+ op = operators.get_operator("timediff_lt")
+ self.assertFalse(
+ op("2014-07-01T00:01:01.000000", "10"), "Passed test_timediff_lt_webui_value."
+ )
+ self.assertFalse(
+ op("2014-07-01T00:01:01.000000", "value_from_webui"),
+ "Passed test_timediff_lt with Value from WebUI as criteria_pattern.",
+ )
+
def test_timediff_gt(self):
op = operators.get_operator("timediff_gt")
self.assertTrue(op("2014-07-01T00:01:01.000000", 1), "Failed test_timediff_gt.")
@@ -958,6 +975,21 @@ class OperatorTest(unittest2.TestCase):
"Passed test_timediff_gt with None as criteria_pattern.",
)
+ def test_timediff_gt_webui_value(self):
+ op = operators.get_operator("timediff_gt")
+ self.assertTrue(op("2014-07-01T00:01:01.000000", "1"), "Failed test_timediff_gt_webui_value.")
+
+ def test_timediff_gt_webui_value_fail(self):
+ op = operators.get_operator("timediff_gt")
+ self.assertFalse(
+ op(date_utils.get_datetime_utc_now().isoformat(), "10"),
+ "Passed test_timediff_gt_webui_value.",
+ )
+ self.assertFalse(
+ op("2014-07-01T00:01:01.000000", "value_from_webui"),
+ "Passed test_timediff_gt with Value from WebUI as criteria_pattern.",
+ )
+
def test_exists(self):
op = operators.get_operator("exists")
self.assertTrue(op(False, None), "Should return True")
