lib/upgrade: Remove TestGithubRelease (fixes #3362)

Skip-check: authors

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3365
This commit is contained in:
Nicolas Braud-Santoni 2016-06-29 19:06:09 +00:00 committed by Jakob Borg
parent 80fd6c2400
commit a9ee4bb9f1
2 changed files with 0 additions and 3845 deletions

File diff suppressed because it is too large Load Diff

View File

@ -9,8 +9,6 @@
package upgrade
import (
"encoding/json"
"os"
"strings"
"testing"
)
@ -59,35 +57,6 @@ func TestCompareVersions(t *testing.T) {
}
}
func TestGithubRelease(t *testing.T) {
var upgrades = map[string]string{
"v0.10.21": "v0.10.30",
"v0.10.29": "v0.10.30",
"v0.10.0-alpha": "v0.10.30",
"v0.10.0-beta": "v0.10.30",
"v0.11.0-beta0+40-g53cb66e-dirty": "v0.11.0-beta0",
}
fd, err := os.Open("testdata/github-releases.json")
if err != nil {
t.Errorf("Missing github-release test data")
}
defer fd.Close()
var rels []Release
json.NewDecoder(fd).Decode(&rels)
for old, target := range upgrades {
upgrade, err := SelectLatestRelease(old, rels)
if err != nil {
t.Error("Error retrieving latest version", err)
}
if upgrade.Tag != target {
t.Errorf("Invalid upgrade release: %v -> %v, but got %v", old, target, upgrade.Tag)
}
}
}
func TestErrorRelease(t *testing.T) {
_, err := SelectLatestRelease("v0.11.0-beta", nil)
if err == nil {