github.com/99MyCql/duffett@v0.1.0/app/data/realTimeData_test.go (about) 1 package data 2 3 import ( 4 "testing" 5 ) 6 7 func TestGetRealTimeData(t *testing.T) { 8 type args struct { 9 tsCode string 10 } 11 tests := []struct { 12 name string 13 args args 14 want *RealTimeData 15 wantErr bool 16 }{ 17 { 18 name: "1", 19 args: args{tsCode: "000001.SZ"}, 20 want: nil, 21 wantErr: false, 22 }, 23 } 24 for _, tt := range tests { 25 t.Run(tt.name, func(t *testing.T) { 26 got, err := GetRealTimeData(tt.args.tsCode) 27 if (err != nil) != tt.wantErr { 28 t.Errorf("GetRealTimeData() error = %v, wantErr %v", err, tt.wantErr) 29 return 30 } 31 t.Log(got) 32 }) 33 } 34 }