- Enhanced the Config struct to support JSON marshaling and unmarshaling with human-readable duration strings for various OAuth settings. - Introduced temporary structures to facilitate the conversion of string duration fields to time.Duration types during JSON operations. - Added utility functions for parsing and formatting duration strings, ensuring accurate handling of time-related configurations. - Updated tests to validate the correct parsing and formatting of duration fields in the configuration.
20 lines
314 B
Go
20 lines
314 B
Go
package openapi
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/yaoapp/yao/config"
|
|
"github.com/yaoapp/yao/test"
|
|
)
|
|
|
|
func TestLoad(t *testing.T) {
|
|
test.Prepare(t, config.Conf)
|
|
defer test.Clean()
|
|
|
|
_, err := Load(config.Conf)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
assert.NotNil(t, Server)
|
|
}
|