(hs2_client, *args, **kwargs)
| 52 | # direct access to the TOpenSessionReq parameters. |
| 53 | @contextmanager |
| 54 | def ScopedSession(hs2_client, *args, **kwargs): |
| 55 | try: |
| 56 | open_session_req = TCLIService.TOpenSessionReq(*args, **kwargs) |
| 57 | session = hs2_client.OpenSession(open_session_req) |
| 58 | yield session |
| 59 | finally: |
| 60 | if session.status.statusCode != TCLIService.TStatusCode.SUCCESS_STATUS: |
| 61 | return |
| 62 | close_session_req = TCLIService.TCloseSessionReq() |
| 63 | close_session_req.sessionHandle = session.sessionHandle |
| 64 | HS2TestSuite.check_response(hs2_client.CloseSession(close_session_req)) |
| 65 | |
| 66 | |
| 67 | class TestHS2(HS2TestSuite): |
no test coverage detected