mirror of https://github.com/tad17/pic
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
494 B
Go
28 lines
494 B
Go
package pic
|
|
|
|
import (
|
|
//"log"
|
|
"testing"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/jmoiron/sqlx"
|
|
)
|
|
|
|
var db = openDB()
|
|
|
|
func openDB() *sqlx.DB {
|
|
db, err := sqlx.Open("mysql", "itman:X753951x@(xigmanas:3306)/sea")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return db
|
|
}
|
|
|
|
func TestGetSmallGifs(t *testing.T) {
|
|
seadb, err := NewSeaDB(db)
|
|
assert.Nil(t, err)
|
|
|
|
urls, err := seadb.SmallGifs()
|
|
assert.Nil(t, err)
|
|
assert.Equal(t, len(urls), 10, "должны получить 10 записей")
|
|
}
|