25 lines
349 B
Go
25 lines
349 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/stretchr/testify/assert"
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestCsv_getCsvFile(t *testing.T) {
|
|
|
|
c := &Csv{}
|
|
f, err := c.getCsvFile(1)
|
|
assert.Nil(t, err)
|
|
assert.NotNil(t, f)
|
|
f.Open()
|
|
f.Close()
|
|
fmt.Println(c.dirTemp)
|
|
|
|
assert.DirExists(t, c.dirTemp)
|
|
os.RemoveAll(c.dirTemp)
|
|
assert.NoDirExists(t, c.dirTemp)
|
|
|
|
}
|