question 488 Application Delivery · hard
Test the duration parser
Timeouts and schedules in the worker's settings use parse_duration(text): a whole number of 1 or more directly followed by s, m, h or d (spaces around the whole text ignored), returning seconds; anything else raises ValueError. Write tests that pass for a correct parser and catch broken ones. Leave the calls to Check.
Target
parse_duration(text): "30s" → 30, "5m" → 300, "2h" → 7200, "1d" → 86400Your tests
test_ functions or a unittest.TestCase class in your fileGradedpass for a correct parser; fail for each of three broken parsers