File: test_vim_session_oriented_stub.py

package info (click to toggle)
python-pyvmomi 6.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 14,984 kB
  • sloc: python: 9,206; xml: 77; makefile: 11
file content (13 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
import tests

from pyVim import connect


class SoapAdapterTests(tests.VCRTestBase):
    def test_invoke_method_login_session_exception(self):
        def login_fail(*args, **kwargs):
            raise vim_session.SESSION_EXCEPTIONS[0]()

        stub = connect.SoapStubAdapter()
        vim_session = connect.VimSessionOrientedStub(stub, login_fail)
        self.assertRaises(SystemError, vim_session.InvokeAccessor, "mo", "info")