Add ICU message format support
[chromium-blink-merge.git] / testing / legion / examples / http_example / http_client.py
blob830ae620acbbedb0621877b362523ad56eaf907c
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import argparse
6 import httplib
7 import sys
10 def GetArgs():
11 """Returns the specified command line args."""
12 parser = argparse.ArgumentParser()
13 parser.add_argument('--server', required=True)
14 parser.add_argument('--port', required=True, type=int)
15 return parser.parse_args()
18 def main():
19 """Get the webpage and assert the text == 'SUCCESS!'."""
20 args = GetArgs()
21 conn = httplib.HTTPConnection(args.server, args.port)
22 conn.request('GET', '/')
23 response = conn.getresponse()
24 assert response.read() == 'SUCCESS!'
27 if __name__ == '__main__':
28 sys.exit(main())