示例#1
0
 def test__state(self):
     context = LiveContext(timeframe=None, conf_dir='')
     self.assertEqual(context.state(), ContextState.LIVE)
示例#2
0
 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')
示例#3
0
 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())
示例#4
0
 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')