Files
Hippolyzer/pyogp/lib/base/tests/agent.txt
2009-03-03 01:40:52 +00:00

24 lines
1.4 KiB
Plaintext

Agent
=====
The 'agent' login case
======================
First, initialize the agent
>>> from pyogp.lib.base.agent import Agent
>>> client = Agent()
For testing, we need to set up the loginhandler and the loginuri
>>> loginuri = 'http://localhost:12345/login.cgi'
Setup test: import of the mock network client handler
>>> from pyogp.lib.base.tests.mock_xmlrpc import MockXMLRPC
>>> from pyogp.lib.base.tests.base import MockXMLRPCLogin
>>> loginhandler = MockXMLRPC(MockXMLRPCLogin(), loginuri)
Now let's log it in
>>> client.login('http://localhost:12345/login.cgi', 'firstname', 'lastname', 'password', start_location = 'start_location', handler = loginhandler)
Evaluate the login response
>>> client.login_response
{'region_y': '256', 'region_x': '256', 'first_name': '"first"', 'secure_session_id': '00000000-0000-0000-0000-000000000000', 'sim_ip': '127.0.0.1', 'agent_access': 'M', 'circuit_code': '600000000', 'look_at': '[r0.9963859999999999939,r-0.084939700000000006863,r0]', 'session_id': '00000000-0000-0000-0000-000000000000', 'udp_blacklist': 'EnableSimulator,TeleportFinish,CrossedRegion', 'seed_capability': 'https://somesim:12043/cap/00000000-0000-0000-0000-000000000000', 'agent_id': '00000000-0000-0000-0000-000000000000', 'last_name': 'last', 'inventory_host': 'someinvhost', 'start_location': 'last', 'sim_port': '13001', 'message': 'message', 'login': 'true', 'seconds_since_epoch': '1234567890'}