xdrive_test.go 605 B

123456789101112131415
  1. package sub
  2. import "testing"
  3. // XDRIVE has no share-link format: a link would either drop the storage secrets both
  4. // ends need or print them into every QR code, so only the JSON subscription carries it.
  5. func TestGetLink_SkipsXdriveStreams(t *testing.T) {
  6. stream := `{"network":"xdrive","security":"none",
  7. "xdriveSettings":{"service":"Google Drive","remoteFolder":"xray-tunnel","secrets":["id","secret","token"]}}`
  8. inbound := flowTestInbound(stream, "none")
  9. if link := (&SubService{}).GetLink(inbound, "user"); link != "" {
  10. t.Fatalf("GetLink = %q, want no link for an XDRIVE stream", link)
  11. }
  12. }