Exemplo n.º 1
0
 def test_loginDomains_setting(self, apic):
     """Verify that the loginDomain can be set."""
     url, user, password, secure = apic
     secure = False if secure == "False" else True
     session = cobra.mit.session.LoginSession(url, user, password, secure=secure)
     session.getLoginDomains()
     session.loginDomain = session.domains[0]
     assert session.loginDomain == session.domains[0]
Exemplo n.º 2
0
 def test_getDomains(self, apic):
     """Verify that the getLoginDomains() method works.
     """
     url, user, password, secure = apic
     secure = False if secure == "False" else True
     session = cobra.mit.session.LoginSession(url, user, password, secure=secure)
     session.getLoginDomains()
     assert session.domains != []
Exemplo n.º 3
0
 def test_loginDomains_setting(self, apic):
     """Verify that the loginDomain can be set."""
     url, user, password, secure = apic
     secure = False if secure == 'False' else True
     session = cobra.mit.session.LoginSession(url,
                                              user,
                                              password,
                                              secure=secure)
     session.getLoginDomains()
     session.loginDomain = session.domains[0]
     assert session.loginDomain == session.domains[0]
Exemplo n.º 4
0
 def test_getDomains(self, apic):
     """Verify that the getLoginDomains() method works.
     """
     url, user, password, secure = apic
     secure = False if secure == 'False' else True
     session = cobra.mit.session.LoginSession(url,
                                              user,
                                              password,
                                              secure=secure)
     session.getLoginDomains()
     assert session.domains != []
Exemplo n.º 5
0
    def test_getLoginDomains_domains_islist(self, apic, getResponseMock):
        """Verify that the getLoginDomains method works."""
        if apic[0] == 'http://mock':
            getResponseMock.start()
        url, user, password, secure = apic

        secure = False if secure == 'False' else True
        session = cobra.mit.session.LoginSession(url, user, password,
                                                 secure=secure,
                                                 requestFormat='json')
        session.getLoginDomains()
        assert isinstance(session.domains, list)
Exemplo n.º 6
0
    def test_getLoginDomains_domains(self, apic, getResponseMock):
        """Verify that the getLoginDomains method works."""
        if apic[0] == 'http://mock':
            getResponseMock.start()
        url, user, password, secure = apic

        secure = False if secure == 'False' else True
        session = cobra.mit.session.LoginSession(url, user, password,
                                                 secure=secure,
                                                 requestFormat='json')
        session.getLoginDomains()
        # Currently the APIC ALWAYS returns DefaultAuth in the results
        assert len(session.domains) > 0
Exemplo n.º 7
0
    def test_getLoginDomains_domains_islist(self, apic, getResponseMock):
        """Verify that the getLoginDomains method works."""
        if apic[0] == 'http://mock':
            getResponseMock.start()
        url, user, password, secure = apic

        secure = False if secure == 'False' else True
        session = cobra.mit.session.LoginSession(url,
                                                 user,
                                                 password,
                                                 secure=secure,
                                                 requestFormat='json')
        session.getLoginDomains()
        assert isinstance(session.domains, list)
Exemplo n.º 8
0
    def test_getLoginDomains_domains(self, apic, getResponseMock):
        """Verify that the getLoginDomains method works."""
        if apic[0] == 'http://mock':
            getResponseMock.start()
        url, user, password, secure = apic

        secure = False if secure == 'False' else True
        session = cobra.mit.session.LoginSession(url,
                                                 user,
                                                 password,
                                                 secure=secure,
                                                 requestFormat='json')
        session.getLoginDomains()
        # Currently the APIC ALWAYS returns DefaultAuth in the results
        assert len(session.domains) > 0