688ee1978e
Add Docs on how to deal with this breaking change doResponse should return responce in all cases, to prosses things manualy if wanted helper func return http response Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/416 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
23 lines
568 B
Go
23 lines
568 B
Go
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package gitea
|
|
|
|
import (
|
|
"log"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestVersion(t *testing.T) {
|
|
log.Printf("== TestVersion ==")
|
|
c := newTestClient()
|
|
rawVersion, _, err := c.ServerVersion()
|
|
assert.NoError(t, err)
|
|
assert.True(t, true, rawVersion != "")
|
|
|
|
assert.NoError(t, c.CheckServerVersionConstraint(">= 1.11.0"))
|
|
assert.Error(t, c.CheckServerVersionConstraint("< 1.11.0"))
|
|
}
|