44 AuthConfig ,
55 Config ,
66 EnvironConfigFactory ,
7- SentryConfig ,
87 ServerConfig ,
98 UpstreamRegistryConfig ,
109 UpstreamType ,
11- ZipkinConfig ,
1210)
1311
1412
@@ -64,9 +62,6 @@ def test_oauth(self) -> None:
6462 "NP_REGISTRY_UPSTREAM_TOKEN_REGISTRY_SCOPE" : "" ,
6563 "NP_REGISTRY_UPSTREAM_TOKEN_REPO_SCOPE_ACTIONS" : "push,pull" ,
6664 "NP_CLUSTER_NAME" : "test-cluster" ,
67- "NP_ZIPKIN_URL" : "http://zipkin.io:9411/" ,
68- "NP_SENTRY_DSN" : "https://sentry" ,
69- "NP_SENTRY_CLUSTER_NAME" : "test" ,
7065 }
7166 config = EnvironConfigFactory (environ = environ ).create ()
7267 assert config == Config (
@@ -88,8 +83,6 @@ def test_oauth(self) -> None:
8883 service_token = "test_auth_token" ,
8984 ),
9085 cluster_name = "test-cluster" ,
91- zipkin = ZipkinConfig (URL ("http://zipkin.io:9411/" )),
92- sentry = SentryConfig (dsn = URL ("https://sentry" ), cluster_name = "test" ),
9386 )
9487 assert config .upstream_registry .is_oauth
9588
@@ -179,56 +172,3 @@ def test_basic(self) -> None:
179172 )
180173 assert config .upstream_registry .is_basic
181174 assert not config .upstream_registry .is_oauth
182-
183- def test_create_zipkin_none (self ) -> None :
184- result = EnvironConfigFactory ({}).create_zipkin ()
185-
186- assert result is None
187-
188- def test_create_zipkin_default (self ) -> None :
189- env = {"NP_ZIPKIN_URL" : "https://zipkin:9411" }
190- result = EnvironConfigFactory (env ).create_zipkin ()
191-
192- assert result == ZipkinConfig (url = URL ("https://zipkin:9411" ))
193-
194- def test_create_zipkin_custom (self ) -> None :
195- env = {
196- "NP_ZIPKIN_URL" : "https://zipkin:9411" ,
197- "NP_ZIPKIN_APP_NAME" : "api" ,
198- "NP_ZIPKIN_SAMPLE_RATE" : "1" ,
199- }
200- result = EnvironConfigFactory (env ).create_zipkin ()
201-
202- assert result == ZipkinConfig (
203- url = URL ("https://zipkin:9411" ), app_name = "api" , sample_rate = 1
204- )
205-
206- def test_create_sentry_none (self ) -> None :
207- result = EnvironConfigFactory ({}).create_sentry ()
208-
209- assert result is None
210-
211- def test_create_sentry_default (self ) -> None :
212- env = {
213- "NP_SENTRY_DSN" : "https://sentry" ,
214- "NP_SENTRY_CLUSTER_NAME" : "test" ,
215- }
216- result = EnvironConfigFactory (env ).create_sentry ()
217-
218- assert result == SentryConfig (dsn = URL ("https://sentry" ), cluster_name = "test" )
219-
220- def test_create_sentry_custom (self ) -> None :
221- env = {
222- "NP_SENTRY_DSN" : "https://sentry" ,
223- "NP_SENTRY_APP_NAME" : "api" ,
224- "NP_SENTRY_CLUSTER_NAME" : "test" ,
225- "NP_SENTRY_SAMPLE_RATE" : "1" ,
226- }
227- result = EnvironConfigFactory (env ).create_sentry ()
228-
229- assert result == SentryConfig (
230- dsn = URL ("https://sentry" ),
231- app_name = "api" ,
232- cluster_name = "test" ,
233- sample_rate = 1 ,
234- )
0 commit comments