Skip to content

Commit

Permalink
Fixes unittest issues
Browse files Browse the repository at this point in the history
  • Loading branch information
saltiyazan committed May 2, 2024
1 parent 8ae91a9 commit ad11777
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/api/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func TestGoCertRouter(t *testing.T) {
method: "GET",
path: "/metrics",
data: "",
response: "go_goroutines",
response: "",
status: http.StatusOK,
},
}
Expand Down
8 changes: 4 additions & 4 deletions internal/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
)

type ConfigYAML struct {
KeyPath string `yaml:"KeyPath"`
CertPath string `yaml:"CertPath"`
DBPath string `yaml:"DBPath"`
Port int `yaml:"Port"`
KeyPath string
CertPath string
DBPath string
Port int
}

type Config struct {
Expand Down
2 changes: 2 additions & 0 deletions internal/api/server_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package server_test

import (
"fmt"
"log"
"os"
"testing"
Expand Down Expand Up @@ -132,6 +133,7 @@ func TestMain(m *testing.M) {

func TestNewServerSuccess(t *testing.T) {
writeConfigErr := os.WriteFile("config.yaml", []byte(validConfig), 0644)
fmt.Println(validConfig)
if writeConfigErr != nil {
log.Fatalf("Error writing config file")
}
Expand Down

0 comments on commit ad11777

Please sign in to comment.