MCPcopy
hub / github.com/mxpv/podsync / TestApplyDefaults

Function TestApplyDefaults

cmd/podsync/config_test.go:129–154  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

127}
128
129func TestApplyDefaults(t *testing.T) {
130 const file = `
131[server]
132data_dir = "/data"
133
134[feeds]
135 [feeds.A]
136 url = "https://youtube.com/watch?v=ygIUF678y40"
137`
138 path := setup(t, file)
139 defer os.Remove(path)
140
141 config, err := LoadConfig(path)
142 assert.NoError(t, err)
143 assert.NotNil(t, config)
144
145 assert.Len(t, config.Feeds, 1)
146 feed, ok := config.Feeds["A"]
147 require.True(t, ok)
148
149 assert.EqualValues(t, feed.UpdatePeriod, model.DefaultUpdatePeriod)
150 assert.EqualValues(t, feed.PageSize, 50)
151 assert.EqualValues(t, feed.Quality, "high")
152 assert.EqualValues(t, feed.Custom.CoverArtQuality, "high")
153 assert.EqualValues(t, feed.Format, "video")
154}
155
156func TestHttpServerListenAddress(t *testing.T) {
157 const file = `

Callers

nothing calls this directly

Calls 3

setupFunction · 0.85
LoadConfigFunction · 0.85
LenMethod · 0.80

Tested by

no test coverage detected