mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
feat(wopi): fetch discover endpoint
This commit is contained in:
25
pkg/wopi/discovery_test.go
Normal file
25
pkg/wopi/discovery_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package wopi
|
||||
|
||||
import (
|
||||
model "github.com/cloudreve/Cloudreve/v3/models"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/request"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"net/url"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDiscovery(t *testing.T) {
|
||||
a := assert.New(t)
|
||||
endpoint, _ := url.Parse("http://localhost:8001/hosting/discovery")
|
||||
client := &client{
|
||||
cache: cache.Store,
|
||||
http: request.NewClient(),
|
||||
config: config{
|
||||
discoveryEndpoint: endpoint,
|
||||
},
|
||||
}
|
||||
|
||||
a.NoError(client.refreshDiscovery())
|
||||
client.NewSession(nil, &model.File{Name: "123.pptx"}, ActionPreview)
|
||||
}
|
||||
Reference in New Issue
Block a user