Exemplo n.º 1
0
class JoinQuantClientTest(unittest.TestCase):
    def setUp(self):
        config = ConfigParser()
        dir_path = os.path.dirname(os.path.realpath(__file__))
        config.readfp(
            codecs.open('{}/../../config/config.ini'.format(dir_path),
                        encoding="utf_8_sig"))
        self._jq_client = JoinQuantClient(**dict(config.items('JoinQuant')))

    def test_query(self):
        self._jq_client.login()
        transactions = self._jq_client.query()
        self.assertTrue(isinstance(transactions, list))
class JoinQuantClientTest(unittest.TestCase):
    def setUp(self):
        config = ConfigParser()
        dir_path = os.path.dirname(os.path.realpath(__file__))
        config.read('{}/../../config/config.ini'.format(dir_path))
        self._jqClient = JoinQuantClient(
            username=config.get('JoinQuant', 'username'),
            password=config.get('JoinQuant', 'password'),
            backtest_id=config.get('JoinQuant', 'backtestId'))

    def test_query(self):
        self._jqClient.login()
        transaction_detail = self._jqClient.query()
        self.assertTrue(transaction_detail.has_key('data'))