예제 #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')