refactor: move lib/policy/config to lib/config

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-11-19 15:53:30 -05:00
parent 02989f03d0
commit 8912050882
97 changed files with 41 additions and 40 deletions

View File

@@ -18,7 +18,7 @@ func TestInvalidChallengeMethod(t *testing.T) {
}
func TestBadConfigs(t *testing.T) {
finfos, err := os.ReadDir("policy/config/testdata/bad")
finfos, err := os.ReadDir("config/testdata/bad")
if err != nil {
t.Fatal(err)
}
@@ -26,7 +26,7 @@ func TestBadConfigs(t *testing.T) {
for _, st := range finfos {
st := st
t.Run(st.Name(), func(t *testing.T) {
if _, err := LoadPoliciesOrDefault(t.Context(), filepath.Join("policy", "config", "testdata", "bad", st.Name()), anubis.DefaultDifficulty); err == nil {
if _, err := LoadPoliciesOrDefault(t.Context(), filepath.Join("config", "testdata", "bad", st.Name()), anubis.DefaultDifficulty); err == nil {
t.Fatal(err)
} else {
t.Log(err)
@@ -36,7 +36,7 @@ func TestBadConfigs(t *testing.T) {
}
func TestGoodConfigs(t *testing.T) {
finfos, err := os.ReadDir("policy/config/testdata/good")
finfos, err := os.ReadDir("config/testdata/good")
if err != nil {
t.Fatal(err)
}
@@ -46,13 +46,13 @@ func TestGoodConfigs(t *testing.T) {
t.Run(st.Name(), func(t *testing.T) {
t.Run("with-thoth", func(t *testing.T) {
ctx := thothmock.WithMockThoth(t)
if _, err := LoadPoliciesOrDefault(ctx, filepath.Join("policy", "config", "testdata", "good", st.Name()), anubis.DefaultDifficulty); err != nil {
if _, err := LoadPoliciesOrDefault(ctx, filepath.Join("config", "testdata", "good", st.Name()), anubis.DefaultDifficulty); err != nil {
t.Fatal(err)
}
})
t.Run("without-thoth", func(t *testing.T) {
if _, err := LoadPoliciesOrDefault(t.Context(), filepath.Join("policy", "config", "testdata", "good", st.Name()), anubis.DefaultDifficulty); err != nil {
if _, err := LoadPoliciesOrDefault(t.Context(), filepath.Join("config", "testdata", "good", st.Name()), anubis.DefaultDifficulty); err != nil {
t.Fatal(err)
}
})