Private
Public Access
1
0

server: Return proper version

This commit is contained in:
2023-06-16 23:38:48 -07:00
parent a2b14c88ea
commit 53870e25a9
2 changed files with 5 additions and 2 deletions

View File

@@ -5,6 +5,8 @@ import (
"code.severnaya.net/kordophone-mock/v2/model"
)
const VERSION = "Kordophone-2.0"
type Server struct {
version string
conversations []model.Conversation
@@ -12,7 +14,7 @@ type Server struct {
func NewServer() *Server {
return &Server{
version: "1.0",
version: VERSION,
conversations: []model.Conversation{},
}
}

View File

@@ -9,6 +9,7 @@ import (
"time"
"code.severnaya.net/kordophone-mock/v2/model"
"code.severnaya.net/kordophone-mock/v2/server"
"code.severnaya.net/kordophone-mock/v2/web"
)
@@ -25,7 +26,7 @@ func TestVersion(t *testing.T) {
t.Fatalf("Error decoding body: %s", body)
}
if string(body) != "1.0" {
if string(body) != server.VERSION {
t.Fatalf("Unexpected return value: %s (expected %s)", body, "1.0")
}
}