File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111# ANY KIND, either express or implied. See the License for the specific
1212# language governing permissions and limitations under the License.
1313import sqlite3
14- from unittest .mock import MagicMock , patch
14+ from unittest .mock import MagicMock , PropertyMock , patch
1515
1616import pytest
1717from botocore .exceptions import MD5UnavailableError
@@ -313,12 +313,7 @@ def test_add_session_id_component_to_user_agent_extra():
313313
314314
315315def test_entrypoint_catches_bare_exceptions ():
316- class FakeOrchestrator (CLISessionOrchestrator ):
317- def __init__ (self ):
318- pass
319-
320- def session_id (self ):
321- raise Exception ()
322-
316+ mock_orchestrator = MagicMock (CLISessionOrchestrator )
317+ type(mock_orchestrator ).session_id = PropertyMock (side_effect = Exception )
323318 session = MagicMock (Session )
324- add_session_id_component_to_user_agent_extra (session , FakeOrchestrator () )
319+ add_session_id_component_to_user_agent_extra (session , mock_orchestrator )
You can’t perform that action at this time.
0 commit comments