23 lines
815 B
Python
23 lines
815 B
Python
import unittest
|
|
|
|
from edmond.tests.test_plugin import get_plugin_patcher
|
|
from ..reminder import ReminderPlugin
|
|
|
|
|
|
class TestReminderPlugin(unittest.TestCase):
|
|
def test_parse_time(self):
|
|
with get_plugin_patcher(ReminderPlugin):
|
|
plugin = ReminderPlugin()
|
|
plugin.config = {
|
|
"day_letter": "d",
|
|
"hour_letter": "h",
|
|
"minute_letter": "m",
|
|
"second_letter": "s",
|
|
}
|
|
result = plugin.parse_time("1d")
|
|
self.assertDictEqual(result, {"day": 1})
|
|
result = plugin.parse_time("1h30m")
|
|
self.assertDictEqual(result, {"hour": 1, "minute": 30})
|
|
result = plugin.parse_time("99d99m99s")
|
|
self.assertDictEqual(result, {"day": 99, "minute": 99, "second": 99})
|