mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-12 11:50:11 +08:00
ENH: Provides a more descriptive error if market_open or market_close are provided a non-keyword argument that is not a datetime.timedelta
This commit is contained in:
@@ -74,6 +74,11 @@ class TestUtils(TestCase):
|
||||
with self.assertRaises(ValueError):
|
||||
_build_offset(datetime.timedelta(minutes=1), {'minutes': 1}, None)
|
||||
|
||||
def test_build_offset_exc(self):
|
||||
with self.assertRaises(TypeError):
|
||||
# object() is not an instance of a timedelta.
|
||||
_build_offset(object(), {}, None)
|
||||
|
||||
def test_build_offset_kwargs(self):
|
||||
kwargs = {'minutes': 1}
|
||||
self.assertEqual(
|
||||
|
||||
Reference in New Issue
Block a user