36 lines
762 B
Go
36 lines
762 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"testing"
|
|
"time"
|
|
|
|
. "gopkg.in/check.v1"
|
|
)
|
|
|
|
type AlbumDescriptionGetterSuite struct {
|
|
g *AlbumDescriptionGetter
|
|
}
|
|
|
|
var _ = Suite(&AlbumDescriptionGetterSuite{})
|
|
|
|
func (s *AlbumDescriptionGetterSuite) SetUpTest(c *C) {
|
|
s.g = &AlbumDescriptionGetter{getter: testGetter}
|
|
}
|
|
|
|
func (s *AlbumDescriptionGetterSuite) TestGet(c *C) {
|
|
if testing.Short() {
|
|
c.Skip("This test is really slow")
|
|
}
|
|
start := time.Now()
|
|
for _, a := range albumsDataTest {
|
|
aStripped := StripNonCsvField(a)
|
|
if c.Check(s.g.Get(&aStripped), IsNil) == true {
|
|
//we skip the fetch date, for sure it will always expire
|
|
aStripped.FetchDate = a.FetchDate
|
|
c.Check(aStripped, DeepEquals, a)
|
|
}
|
|
}
|
|
log.Printf("%s: %s", c.TestName(), time.Since(start))
|
|
}
|