Exemple #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]
Exemple #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 != []
Exemple #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]
Exemple #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 != []
Exemple #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)
Exemple #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
Exemple #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)
Exemple #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