(t *testing.T)
| 127 | } |
| 128 | |
| 129 | func TestApplyDefaults(t *testing.T) { |
| 130 | const file = ` |
| 131 | [server] |
| 132 | data_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 | |
| 156 | func TestHttpServerListenAddress(t *testing.T) { |
| 157 | const file = ` |
nothing calls this directly
no test coverage detected