File tree Expand file tree Collapse file tree
ckanext/files/tests/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,9 +54,9 @@ def test_protocols_setting(self, faker: Faker):
5454 location = shared .Location ("file.txt" )
5555
5656 url = faker .url (["http" ])
57- with RequestsMock () as rsps :
58- rsps . add ( "HEAD" , url )
59- with pytest . raises ( shared . exc . ContentError ):
57+ with pytest . raises ( shared . exc . ContentError ): # noqa: PT012, SIM117
58+ with RequestsMock () as rsps :
59+ rsps . add ( "HEAD" , url )
6060 storage .upload (location , shared .make_upload (url .encode ()))
6161
6262 url = faker .url (["https" ])
@@ -79,9 +79,9 @@ def test_domains_setting(self, faker: Faker):
7979 location = shared .Location ("file.txt" )
8080
8181 url = f"https://notallowed.com/{ faker .file_name ()} "
82- with RequestsMock () as rsps :
83- rsps . add ( "HEAD" , url )
84- with pytest . raises ( shared . exc . ContentError ):
82+ with pytest . raises ( shared . exc . ContentError ): # noqa: PT012, SIM117
83+ with RequestsMock () as rsps :
84+ rsps . add ( "HEAD" , url )
8585 storage .upload (location , shared .make_upload (url .encode ()))
8686
8787 url = f"https://{ allowed_domain } /{ faker .file_name ()} "
You can’t perform that action at this time.
0 commit comments