forked from onedr0p/exportarr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix onedr0p#154: Do not require Api Key or URL in parent config, vali…
…date in child config (onedr0p#157) Signed-off-by: Russell Troxel <[email protected]>
- Loading branch information
Showing
4 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package config | ||
|
||
import ( | ||
"testing" | ||
|
||
base_config "github.com/onedr0p/exportarr/internal/config" | ||
"github.com/spf13/pflag" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestArrConfigIntegration(t *testing.T) { | ||
require := require.New(t) | ||
|
||
configFlags := pflag.NewFlagSet("test", pflag.ContinueOnError) | ||
base_config.RegisterConfigFlags(configFlags) | ||
|
||
arrConfigFlags := testFlagSet() | ||
|
||
t.Setenv("URL", "http://localhost") | ||
t.Setenv("CONFIG", "test_fixtures/config.test_xml") | ||
t.Setenv("PORT", "9792") | ||
t.Setenv("ENABLE_ADDITIONAL_METRICS", "true") | ||
t.Setenv("ENABLE_UNKNOWN_QUEUE_ITEMS", "false") | ||
|
||
config, err := base_config.LoadConfig(configFlags) | ||
require.NoError(err) | ||
arrConfig, err := LoadArrConfig(*config, arrConfigFlags) | ||
require.NoError(err) | ||
|
||
require.NoError(config.Validate()) | ||
require.NoError(arrConfig.Validate()) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters