vehicle_test.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package vehicle
  2. import (
  3. "context"
  4. "gd_vehicle/apis"
  5. "encoding/json"
  6. "fmt"
  7. //"time"
  8. "testing"
  9. )
  10. /*func Test_VechicleVerifyOwner(t *testing.T) {
  11. req := apis.VechicleVerifyOwnerReq{PlateNo: "川A33E22", AppKey: "3333333", Owner: "熊杰"}
  12. reply := apis.VechicleVerifyOwnerReply{}
  13. fmt.Println(req)
  14. if err := xcli.Call(context.Background(), "VechicleVerifyOwner", req, &reply); err != nil {
  15. t.Error("failed to call: ", err)
  16. } else {
  17. d, _ := json.Marshal(reply)
  18. t.Log(string(d))
  19. }
  20. }*/
  21. /*func Test_VehicleGetStyle(t *testing.T) {
  22. req := apis.VehicleGetStyleReq{PlateNo: "川A33E22", AppKey: "3333333"}
  23. reply := apis.VehicleGetStyleReply{}
  24. fmt.Println(req)
  25. for i:=1;i<10000;i++{
  26. go func(){
  27. if err := xcli.Call(context.Background(), "VehicleGetStyle", req, &reply); err != nil {
  28. t.Error("failed to call: ", err)
  29. } else {
  30. d, _ := json.Marshal(reply)
  31. t.Log(string(d))
  32. }
  33. }()
  34. }
  35. time.Sleep(time.Second*10)
  36. }*/
  37. func Test_VehicleGetInfo(t *testing.T) {
  38. req := apis.VehicleGetInfoReq{PlateNo: "云F806TT", AppKey: "3333333"}
  39. reply := apis.VehicleGetInfoReply{}
  40. fmt.Println(req)
  41. if err := xcli.Call(context.Background(), "VehicleGetInfo", req, &reply); err != nil {
  42. t.Error("failed to call: ", err)
  43. } else {
  44. d, _ := json.Marshal(reply)
  45. t.Log(string(d))
  46. }
  47. }