def test__state(self): context = LiveContext(timeframe=None, conf_dir='') self.assertEqual(context.state(), ContextState.LIVE)
def create_exchange__not_an_exchange__template(self, async_ccxt): context = LiveContext(timeframe=None, auth_aliases={}, conf_dir='') with self.assertRaises(ValueError) as e: context.create_exchange('not_an_exchange', async_ccxt=async_ccxt) self.assertEqual(str(e.exception), 'Unknown exchange: not_an_exchange')
def test__real_date(self, now_mock): context = LiveContext(timeframe=None, conf_dir='') result = context.real_date() now_mock.assert_called_once_with(tz='UTC') self.assertEqual(result, now_mock())
def test__stop(self): context = LiveContext(timeframe=None, conf_dir='') with self.assertRaises(StopException) as e: context.stop('msg') self.assertEqual(str(e.exception), 'msg')