mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-09-29 21:45:33 +00:00
big scary refactor. sync enable_bluesky_posts with captain record. implement oauth logout handler. implement crew assignment to hold. this caused a lot of circular dependencies and needed to move functions around in order to fix
This commit is contained in:
@@ -368,6 +368,7 @@ func TestBuildMiddlewareConfig(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
defaultHoldDID string
|
||||
baseURL string
|
||||
testMode bool
|
||||
setTestMode bool
|
||||
wantTestMode bool
|
||||
@@ -375,12 +376,14 @@ func TestBuildMiddlewareConfig(t *testing.T) {
|
||||
{
|
||||
name: "normal mode",
|
||||
defaultHoldDID: "did:web:hold01.atcr.io",
|
||||
baseURL: "https://atcr.io",
|
||||
setTestMode: false,
|
||||
wantTestMode: false,
|
||||
},
|
||||
{
|
||||
name: "test mode enabled",
|
||||
defaultHoldDID: "did:web:hold01.atcr.io",
|
||||
baseURL: "https://atcr.io",
|
||||
testMode: true,
|
||||
setTestMode: true,
|
||||
wantTestMode: true,
|
||||
@@ -395,7 +398,7 @@ func TestBuildMiddlewareConfig(t *testing.T) {
|
||||
os.Unsetenv("TEST_MODE")
|
||||
}
|
||||
|
||||
got := buildMiddlewareConfig(tt.defaultHoldDID)
|
||||
got := buildMiddlewareConfig(tt.defaultHoldDID, tt.baseURL)
|
||||
|
||||
registryMW, ok := got["registry"]
|
||||
if !ok {
|
||||
@@ -415,6 +418,10 @@ func TestBuildMiddlewareConfig(t *testing.T) {
|
||||
t.Errorf("default_hold_did = %v, want %v", mw.Options["default_hold_did"], tt.defaultHoldDID)
|
||||
}
|
||||
|
||||
if mw.Options["base_url"] != tt.baseURL {
|
||||
t.Errorf("base_url = %v, want %v", mw.Options["base_url"], tt.baseURL)
|
||||
}
|
||||
|
||||
if mw.Options["test_mode"] != tt.wantTestMode {
|
||||
t.Errorf("test_mode = %v, want %v", mw.Options["test_mode"], tt.wantTestMode)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user