예제 #1
0
파일: test_rest.py 프로젝트: jrragan/cobra
 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]
예제 #2
0
파일: test_rest.py 프로젝트: jrragan/cobra
 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 != []
예제 #3
0
파일: test_rest.py 프로젝트: whchoi98/cobra
 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]
예제 #4
0
파일: test_rest.py 프로젝트: whchoi98/cobra
 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 != []
예제 #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)
예제 #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
예제 #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)
예제 #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