mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
- 在 openai_api_test.go 和 stock_data_api_test.go 文件中 - 注释掉了 TestNewDeepSeekOpenAiConfig 和 TestSearchGuShiTongStockInfo 函数中的 db.Init 调用 - 这可能是为了在不依赖数据库的情况下进行测试,提高测试的独立性和可维护性
31 lines
659 B
Go
31 lines
659 B
Go
package data
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestNewDeepSeekOpenAiConfig(t *testing.T) {
|
|
//db.Init("../../data/stock.db")
|
|
ai := NewDeepSeekOpenAi(context.TODO())
|
|
res := ai.NewChatStream("上海贝岭", "sh600171", "分析以上股票资金流入信息,找出适合买入的股票,给出具体操作建议")
|
|
for {
|
|
select {
|
|
case msg := <-res:
|
|
t.Log(msg)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestGetTopNewsList(t *testing.T) {
|
|
GetTopNewsList(30)
|
|
}
|
|
|
|
func TestSearchGuShiTongStockInfo(t *testing.T) {
|
|
//db.Init("../../data/stock.db")
|
|
SearchGuShiTongStockInfo("hk01810", 60)
|
|
SearchGuShiTongStockInfo("sh600745", 60)
|
|
SearchGuShiTongStockInfo("gb_goog", 60)
|
|
|
|
}
|