forked from TrueCloudLab/rclone
rc/webgui: skip AddPlugin and RemovePlugin tests if download fails
This commit is contained in:
parent
9c01ac9894
commit
cc0421cb9e
1 changed files with 6 additions and 1 deletions
|
@ -5,10 +5,12 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/rclone/rclone/fs/rc"
|
"github.com/rclone/rclone/fs/rc"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
const testPluginName = "rclone-test-plugin"
|
const testPluginName = "rclone-test-plugin"
|
||||||
|
@ -39,7 +41,10 @@ func addPlugin(t *testing.T) {
|
||||||
"url": testPluginURL,
|
"url": testPluginURL,
|
||||||
}
|
}
|
||||||
out, err := addPlugin.Fn(context.Background(), in)
|
out, err := addPlugin.Fn(context.Background(), in)
|
||||||
assert.Nil(t, err)
|
if err != nil && strings.Contains(err.Error(), "bad HTTP status") {
|
||||||
|
t.Skipf("skipping test as plugin download failed: %v", err)
|
||||||
|
}
|
||||||
|
require.Nil(t, err)
|
||||||
assert.Nil(t, out)
|
assert.Nil(t, out)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue