mirror of https://github.com/peter4431/rq.git
Fixed issue#72 (#818)
* Added a custom exception for timeout transfer * Added a util to transfer timeout to a united format * Transfer timeout format when creating a queue or enqueue jobs * Fixed typos * Fixed bug in transfer_timeout function * Added test for function transfer_timeout * Updated transfer_timeout to allow uppercase unit * Renamed function in utilsmain
parent
92cf6f4696
commit
cd529d0ce1
@ -0,0 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import (absolute_import, division, print_function,
|
||||
unicode_literals)
|
||||
|
||||
from tests import RQTestCase
|
||||
from rq.utils import parse_timeout
|
||||
|
||||
|
||||
class TestUtils(RQTestCase):
|
||||
def test_parse_timeout(self):
|
||||
"""Ensure function parse_timeout works correctly"""
|
||||
self.assertEqual(12, parse_timeout(12))
|
||||
self.assertEqual(12, parse_timeout('12'))
|
||||
self.assertEqual(12, parse_timeout('12s'))
|
||||
self.assertEqual(720, parse_timeout('12m'))
|
||||
self.assertEqual(3600, parse_timeout('1h'))
|
||||
self.assertEqual(3600, parse_timeout('1H'))
|
Loading…
Reference in New Issue