Changeset 980
- Timestamp:
- 08/05/08 16:31:22 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
projects/2008/pyogp/pyogp.interop/trunk/pyogp/interop/tests/test_cap_agent_info.py
r974 r980 30 30 self.login_uri = config.get('test_cap_agent_info_setup', 'login_uri') 31 31 self.region_uri = config.get('test_cap_agent_info_setup', 'region_uri') 32 32 33 33 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) 36 42 37 43 def tearDown(self): … … 47 53 """ sends a get to the cap """ 48 54 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 50 62 51 63 def check_response_base(self, result): 52 """ check for the e istence of the correct parameters in the cap response """64 """ check for the existence of the correct parameters in the cap response """ 53 65 54 66 # successful response contains: … … 63 75 # Test Cases # 64 76 ################################### 65 # Until a GET exists for caps (need to clear this up with LL and pyogp), no tests can be run77 # Add moar tests 66 78 67 79 … … 69 81 """ agent/info cap returns the right response for an online agent """ 70 82 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) 73 86 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 pass79 87 80 # etc etc81 88 82 89 projects/2008/pyogp/pyogp.interop/trunk/pyogp/interop/tests/test_cap_region_info.py
r974 r980 33 33 self.client = Agent() 34 34 # 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 35 36 36 37 def tearDown(self): … … 46 47 """ sends a get to the cap """ 47 48 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 49 56 50 57 def check_response_base(self, result): … … 64 71 # Test Cases # 65 72 ################################### 66 # Until a GET exists for caps (need to clear this up with LL and pyogp), no tests can be run73 # region/info is implemented, no reason to write tests for it 67 74 68 75 def test_cap_region_info_base(self):
