Changeset 980

Show
Ignore:
Timestamp:
08/05/08 16:31:22 (4 months ago)
Author:
enus.linden
Message:

added e.code (http code) to caps.py, updating *_info tests

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/2008/pyogp/pyogp.interop/trunk/pyogp/interop/tests/test_cap_agent_info.py

    r974 r980  
    3030        self.login_uri = config.get('test_cap_agent_info_setup', 'login_uri') 
    3131        self.region_uri = config.get('test_cap_agent_info_setup', 'region_uri') 
    32         
     32         
    3333        self.client = Agent() 
    34         # have to auth before being able to get the agent/info cap 
    35         # incomplete until a method for retrieving the cap and calling the URL via GET is available 
     34        self.client.authenticate(self.firstname, self.lastname, self.password, self.login_uri) 
     35        self.caps = self.client.agentdomain.seed_cap.get(['agent/info']) 
     36         
     37        print 'Seed cap is: ' + self.client.agentdomain.seed_cap.public_url 
     38        print 'agent/info cap is: ' + self.caps['agent/info'].public_url 
     39         
     40        # initialize the cap object for use in postToCap 
     41        self.capability = Capability('agent/info', self.caps['agent/info'].public_url) 
    3642         
    3743    def tearDown(self): 
     
    4753        """ sends a get to the cap """ 
    4854 
    49         # create a helper to get the cap 
     55        try: 
     56            result = self.capability.GET() 
     57        except Exception, e: 
     58            #print 'Exception: ' + e.message + ' ' + str(e.args) 
     59            result = str(e.args) 
     60 
     61        return result 
    5062     
    5163    def check_response_base(self, result): 
    52         """ check for the eistence of the correct parameters in the cap response """ 
     64        """ check for the existence of the correct parameters in the cap response """ 
    5365 
    5466        # successful response contains:  
     
    6375#           Test Cases            # 
    6476################################### 
    65     # Until a GET exists for caps (need to clear this up with LL and pyogp), no tests can be run 
     77    # Add moar tests 
    6678 
    6779                      
     
    6981        """ agent/info cap returns the right response for an online agent """ 
    7082         
    71         print 'Until we can request the url for agent/info, we cannot test this' 
    72         pass 
     83        response = self.getCap() 
     84         
     85        self.check_response_base(response) 
    7386     
    74     def test_cap_agent_info_offline(self): 
    75         """ agent/info cap returns the right response for an offline agent """ 
    76          
    77         print 'Until we can request the url for agent/info, we cannot test this' 
    78         pass 
    7987 
    80     # etc etc 
    8188 
    8289 
  • projects/2008/pyogp/pyogp.interop/trunk/pyogp/interop/tests/test_cap_region_info.py

    r974 r980  
    3333        self.client = Agent() 
    3434        # incomplete until a method for retrieving the cap and calling the URL via GET is available 
     35        # will want to post the request for the region/info cap from the sim, and GET it 
    3536         
    3637    def tearDown(self): 
     
    4647        """ sends a get to the cap """ 
    4748 
    48         # create a helper to get the cap 
     49        try: 
     50            result = self.capability.GET() 
     51        except Exception, e: 
     52            #print 'Exception: ' + e.message + ' ' + str(e.args) 
     53            result = str(e.args) 
     54 
     55        return result 
    4956     
    5057    def check_response_base(self, result): 
     
    6471#           Test Cases            # 
    6572################################### 
    66     # Until a GET exists for caps (need to clear this up with LL and pyogp), no tests can be run 
     73    # region/info is implemented, no reason to write tests for it 
    6774 
    6875    def test_cap_region_info_base(self):