Ticket #306: test-306.py

File test-306.py, 0.6 KB (added by thijs, 5 months ago)

Test client for user-agent

Line 
1import logging
2logging.basicConfig(level=logging.DEBUG,
3           format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s')
4
5from pyamf.remoting.client import RemotingService
6
7appName = 'MyApp/0.1.0'
8
9client = RemotingService('http://demo.pyamf.org/gateway/helloworld')
10service = client.getService('echo')
11
12print 'with default user-agent:', service.echo('Hello World!')
13
14
15client = RemotingService('http://demo.pyamf.org/gateway/helloworld',
16                         user_agent=appName)
17service = client.getService('echo')
18
19print 'with custom user-agent:', service.echo('Hello World!')