mirror of https://github.com/statping/statping
36 lines
873 B
Go
36 lines
873 B
Go
![]() |
package integrations
|
||
|
|
||
|
import (
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"github.com/stretchr/testify/require"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestCsvFileIntegration(t *testing.T) {
|
||
|
|
||
|
csvIntegrator.Fields[0].Value = "test_files/example_services.csv"
|
||
|
|
||
|
t.Run("CSV File", func(t *testing.T) {
|
||
|
path := csvIntegrator.Fields[0].Value
|
||
|
assert.Equal(t, "test_files/example_services.csv", path)
|
||
|
})
|
||
|
|
||
|
t.Run("List Services from CSV File", func(t *testing.T) {
|
||
|
services, err := csvIntegrator.List()
|
||
|
require.Nil(t, err)
|
||
|
assert.Equal(t, len(services), 1)
|
||
|
})
|
||
|
|
||
|
t.Run("Confirm Services from CSV File", func(t *testing.T) {
|
||
|
services, err := csvIntegrator.List()
|
||
|
require.Nil(t, err)
|
||
|
assert.Equal(t, "Bulk Upload", services[0].Name)
|
||
|
assert.Equal(t, "http://google.com", services[0].Domain)
|
||
|
assert.Equal(t, 60, services[0].Interval)
|
||
|
for _, s := range services {
|
||
|
t.Log(s)
|
||
|
}
|
||
|
})
|
||
|
|
||
|
}
|