fix: resolved comments

This commit is contained in:
mayur.popli
2025-03-28 17:17:55 +05:30
parent 7ffbfcea3a
commit 889619fba5
7 changed files with 420 additions and 18 deletions

View File

@@ -2,12 +2,28 @@ package model
import (
"errors"
"fmt"
"testing"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v2"
)
// NewSignValidationErrf formats an error message according to a format specifier and arguments,and returns a new instance of SignValidationErr.
func NewSignValidationErrf(format string, a ...any) *SignValidationErr {
return &SignValidationErr{fmt.Errorf(format, a...)}
}
// NewNotFoundErrf formats an error message according to a format specifier and arguments, and returns a new instance of NotFoundErr.
func NewNotFoundErrf(format string, a ...any) *NotFoundErr {
return &NotFoundErr{fmt.Errorf(format, a...)}
}
// NewBadReqErrf formats an error message according to a format specifier and arguments, and returns a new instance of BadReqErr.
func NewBadReqErrf(format string, a ...any) *BadReqErr {
return &BadReqErr{fmt.Errorf(format, a...)}
}
func TestError_Error(t *testing.T) {
err := &Error{
Code: "404",
@@ -154,7 +170,7 @@ func TestRole_UnmarshalYAML_ValidRole(t *testing.T) {
yamlData := []byte("bap")
err := yaml.Unmarshal(yamlData, &role)
assert.NoError(t, err)
assert.NoError(t, err) //TODO: should replace assert here
assert.Equal(t, RoleBAP, role)
}