Этот коммит содержится в:
Chris
2017-11-15 16:08:02 -06:00
коммит произвёл GitHub
родитель 96e3686dd5
Коммит 6eb4b4604c
2 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@@ -56,6 +56,21 @@ func TestSupervisor_InvalidExecutablePath(t *testing.T) {
assert.Error(t, err)
}
func TestSupervisor_NonExistentExecutablePath(t *testing.T) {
dir, err := ioutil.TempDir("", "")
require.NoError(t, err)
defer os.RemoveAll(dir)
ioutil.WriteFile(filepath.Join(dir, "plugin.json"), []byte(`{"id": "foo", "backend": {"executable": "thisfileshouldnotexist"}}`), 0600)
bundle := model.BundleInfoForPath(dir)
supervisor, err := SupervisorProvider(bundle)
require.NotNil(t, supervisor)
require.NoError(t, err)
require.Error(t, supervisor.Start())
}
// If plugin development goes really wrong, let's make sure plugin activation won't block forever.
func TestSupervisor_StartTimeout(t *testing.T) {
dir, err := ioutil.TempDir("", "")
@@ -104,6 +119,10 @@ func TestSupervisor_PluginCrash(t *testing.T) {
return nil
}
func (p *MyPlugin) OnDeactivate() error {
return nil
}
func main() {
rpcplugin.Main(&MyPlugin{})
}