def test_import_export_ebk(self): """Positive case for import & export ebk.""" temp_file = tempfile.NamedTemporaryFile() stocks = XueQiu.list_ashare(page=random.randint(1, 20), size=random.randint(1, 100)) utils.export_ebk(stocks.index, temp_file.name) symbols = utils.import_ebk(temp_file.name) for symbol in symbols: self.assertIn(symbol, stocks.index)
def test_list_ashare(self): """Positive case for list_ashare.""" res = XueQiu.list_ashare() self.assertIsInstance(res, pandas.DataFrame) self.assertGreater(len(res.index), 0)
def test_kline(self): """Positive case for kline.""" stocks = XueQiu.list_ashare(page=random.randint(1, 1000), size=1) res = XueQiu.kline(stocks.index[0]) self.assertIsInstance(res, pandas.DataFrame) self.assertGreater(len(res.index), 0)