mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2025-02-07 16:59:22 +03:00
run previously useless test
This commit is contained in:
parent
f9c4a5d462
commit
cd50039247
@ -1,11 +1,15 @@
|
|||||||
package core
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
@ -20,6 +24,15 @@ func (s *MigrationGeneratorSuite) SetupSuite() {
|
|||||||
s.command = &NewMigrationCommand{Directory: "/tmp"}
|
s.command = &NewMigrationCommand{Directory: "/tmp"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *MigrationGeneratorSuite) Test_FileExists() {
|
||||||
|
var (
|
||||||
|
seededRand *rand.Rand = rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||||
|
notExist = fmt.Sprintf("/tmp/%d", seededRand.Int31())
|
||||||
|
)
|
||||||
|
|
||||||
|
assert.False(s.T(), s.command.FileExists(notExist))
|
||||||
|
}
|
||||||
|
|
||||||
func (s *MigrationGeneratorSuite) Test_Execute() {
|
func (s *MigrationGeneratorSuite) Test_Execute() {
|
||||||
found := false
|
found := false
|
||||||
assert.NoError(s.T(), s.command.Execute([]string{}))
|
assert.NoError(s.T(), s.command.Execute([]string{}))
|
||||||
@ -37,3 +50,7 @@ func (s *MigrationGeneratorSuite) Test_Execute() {
|
|||||||
|
|
||||||
assert.True(s.T(), found)
|
assert.True(s.T(), found)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Test_MigrationGenerator(t *testing.T) {
|
||||||
|
suite.Run(t, new(MigrationGeneratorSuite))
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user