コード例 #1
0
ファイル: context.py プロジェクト: fodrh1201/btrccts
 def test__state(self):
     context = LiveContext(timeframe=None, conf_dir='')
     self.assertEqual(context.state(), ContextState.LIVE)
コード例 #2
0
ファイル: context.py プロジェクト: fodrh1201/btrccts
 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
ファイル: context.py プロジェクト: fodrh1201/btrccts
 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
ファイル: context.py プロジェクト: fodrh1201/btrccts
 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')