@@ -110,7 +110,7 @@ def test_post_invalid_provider(self):
110
110
111
111
def test_post_invalid_secret (self ):
112
112
with self .feature (self .features ):
113
- for provider in ["launchdarkly" , "generic" , " unleash" ]:
113
+ for provider in ["launchdarkly" , "unleash" ]:
114
114
response = self .client .post (
115
115
self .url , data = {"secret" : "a" * 31 , "provider" : provider }
116
116
)
@@ -127,6 +127,19 @@ def test_post_invalid_secret(self):
127
127
"Ensure this field has no more than 32 characters."
128
128
], provider
129
129
130
+ # Generic
131
+ response = self .client .post (self .url , data = {"secret" : "a" * 9 , "provider" : "generic" })
132
+ assert response .status_code == 400 , response .content
133
+ assert response .json ()["secret" ] == [
134
+ "Ensure this field has at least 10 characters."
135
+ ], "generic"
136
+
137
+ response = self .client .post (self .url , data = {"secret" : "a" * 65 , "provider" : "generic" })
138
+ assert response .status_code == 400 , response .content
139
+ assert response .json ()["secret" ] == [
140
+ "Ensure this field has no more than 64 characters."
141
+ ], "generic"
142
+
130
143
# Statsig
131
144
response = self .client .post (self .url , data = {"secret" : "a" * 32 , "provider" : "statsig" })
132
145
assert response .status_code == 400 , response .content
0 commit comments