33 lines
781 B
Go
33 lines
781 B
Go
package jobs
|
|
|
|
import (
|
|
"go-admin/config"
|
|
"testing"
|
|
)
|
|
|
|
func TestProxyJob(t *testing.T) {
|
|
initSetting()
|
|
config.ExtConfig.CliproxyUrl = "https://f.cliproxy.com"
|
|
config.ExtConfig.CliproxyApiUrl = "https://api.cliproxy.com"
|
|
config.ExtConfig.DaisysmsUrl = "https://daisysms.com/stubs/handler_api.php"
|
|
|
|
renewJob := RenewalJob{}
|
|
|
|
if err := renewJob.Exec(nil); err != nil {
|
|
t.Error(err)
|
|
}
|
|
}
|
|
|
|
func TestAutoDeleteJob(t *testing.T) {
|
|
initSetting()
|
|
config.ExtConfig.CliproxyUrl = "https://f.cliproxy.com"
|
|
config.ExtConfig.CliproxyApiUrl = "https://api.cliproxy.com"
|
|
config.ExtConfig.DaisysmsUrl = "https://daisysms.com/stubs/handler_api.php"
|
|
|
|
autoDeleteJob := AutoDeleteJob{}
|
|
|
|
if err := autoDeleteJob.Exec(nil); err != nil {
|
|
t.Error(err)
|
|
}
|
|
}
|