@@ -3510,28 +3510,28 @@ def test_add_from_url_installs_from_downloaded_bytes(self, tmp_path):
35103510 zip_payload = b"fake-zip-bytes"
35113511 install_args = {}
35123512
3513- class _Resp :
3513+ class _MockHTTPResponse :
35143514 def __enter__ (self ):
35153515 return self
35163516
3517- def __exit__ (self , * _args ):
3517+ def __exit__ (self , exc_type , exc_val , exc_tb ):
35183518 return False
35193519
35203520 def read (self ):
35213521 return zip_payload
35223522
3523- def _install_from_zip_bytes (self_obj , payload , _speckit_version , priority = 10 ):
3523+ def _install_from_zip_bytes (_self , payload , _speckit_version , priority = 10 ):
35243524 install_args ["payload" ] = payload
35253525 install_args ["priority" ] = priority
35263526 return fake_manifest
35273527
35283528 with patch .object (Path , "cwd" , return_value = project_dir ), \
3529- patch ("specify_cli.authentication.http.open_url" , return_value = _Resp ()), \
3529+ patch ("specify_cli.authentication.http.open_url" , return_value = _MockHTTPResponse ()), \
35303530 patch .object (ExtensionManager , "install_from_zip_bytes" , _install_from_zip_bytes ), \
35313531 patch .object (ExtensionManager , "install_from_zip" , side_effect = AssertionError ("legacy path install should not be used" )):
35323532 result = runner .invoke (
35333533 app ,
3534- ["extension" , "add" , "../../evil " , "--from" , "https://example.com/ext.zip" ],
3534+ ["extension" , "add" , "ignored-extension-name " , "--from" , "https://example.com/ext.zip" ],
35353535 catch_exceptions = True ,
35363536 )
35373537
0 commit comments