Compare commits
No commits in common. "3184ce476aa47ea6cc73b5bded48d26e872858c7" and "37645e37f71d0643a78d1239e8322617df7eb9ea" have entirely different histories.
3184ce476a
...
37645e37f7
3 changed files with 3 additions and 33 deletions
15
mlp/mlp.go
15
mlp/mlp.go
|
@ -41,18 +41,3 @@ const (
|
||||||
BlockOdyssey BlockID = "EO" // Odyssey block - EO/HM/MT
|
BlockOdyssey BlockID = "EO" // Odyssey block - EO/HM/MT
|
||||||
BlockDefenders BlockID = "DE" // Defenders block - DE/SB/FF
|
BlockDefenders BlockID = "DE" // Defenders block - DE/SB/FF
|
||||||
)
|
)
|
||||||
|
|
||||||
var allSets = []SetID{
|
|
||||||
SetPremiere,
|
|
||||||
SetCanterlotNights,
|
|
||||||
SetRockNRave,
|
|
||||||
SetCelestialSolstice,
|
|
||||||
SetCrystalGames,
|
|
||||||
SetAbsoluteDiscord,
|
|
||||||
SetEquestrialOdysseys,
|
|
||||||
SetHighMagic,
|
|
||||||
SetMarksInTime,
|
|
||||||
SetDefendersOfEquestria,
|
|
||||||
SetSeaquestriaBeyond,
|
|
||||||
SetFriendsForever,
|
|
||||||
}
|
|
||||||
|
|
11
mlp/set.go
11
mlp/set.go
|
@ -120,14 +120,3 @@ func LoadSetHTTP(id SetID) (*Set, error) {
|
||||||
|
|
||||||
return LoadSetBytes(id, data)
|
return LoadSetBytes(id, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadAllSets just loads all sets from the web
|
|
||||||
func LoadAllSets() error {
|
|
||||||
for _, set := range allSets {
|
|
||||||
_, err := LoadSetHTTP(set)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
|
@ -75,12 +75,6 @@ func TestAllLoads(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("[LoadSetMemory] Could not load set: %s", err.Error())
|
t.Fatalf("[LoadSetMemory] Could not load set: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load all remaining sets
|
|
||||||
err = mlp.LoadAllSets()
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("[LoadAllSets] Could not load remaining sets: %s", err.Error())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestNotLoadedErr tests that LoadSetMemory fails if set is not cached
|
// TestNotLoadedErr tests that LoadSetMemory fails if set is not cached
|
||||||
|
@ -172,8 +166,10 @@ func TestMalformedJSONLoad(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var testServer *httptest.Server
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
|
testServer = httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
|
||||||
switch req.URL.Path {
|
switch req.URL.Path {
|
||||||
case "/nopenope.json":
|
case "/nopenope.json":
|
||||||
// 404
|
// 404
|
||||||
|
|
Loading…
Reference in a new issue