def test_terminate_ssm_session(ssm_mock, instance_id): sess = SSMSession(instance_id=instance_id, ssm=ssm_mock) sess.create() sess.terminate() assert ssm_mock.terminate_session.called
def test_terminate_ssm_session(self): with patch.object(self.ssm, 'terminate_session', return_value=self.response): sess = SSMSession(instance_id=self.instance_id, ssm=self.ssm) sess.create() sess.terminate() self.assertTrue(self.ssm.terminate_session.called)