Commits

Anonymous committed c1931e7

Add connection end status after each test in autobahn test suite client

Comments (0)

Files changed (1)

autobahn_test_client.py

 #!/usr/bin/env python
 
+from __future__ import print_function
 from twisted.internet import reactor
 from websocket_client import WebSocketClientFactory, WebSocketClientHandler
 from twisted.internet.endpoints import TCP4ClientEndpoint
         return "<AutobahnTestSuiteClient, case %d>" % self.factory.case
 
     def connectionEstablished(self):
-        print("Case %d" % self.factory.case)
+        print("Case %d: " % self.factory.case, end="")
 
     def frameReceived(self, data):
         ## Just write data back
         self.writeBinary(data)
 
     def connectionLost(self, reason):
+        print(reason.getErrorMessage())
         if self.factory.case < self.factory.last_case:
             reactor.connectTCP(host,
                                port,
     handler = AutobahnUpdateReportClient
     def __init__(self, base_url):
         host = urlparse(base_url).hostname
-        print("Updating report (check result at: http://%s:9090/reports/clients/index.html)"
-                                % host)
+        print("Updating report (check result at: http://%s:9090/reports/clients/index.html): "
+                                % host, end="")
         WebSocketClientFactory.__init__(self,
                                         base_url + "updateReports?agent=%s" % AGENT)
 
         factory = AutobahnUpdateReportClientFactory(base_url=args.url)
         point.connect(factory).addErrback(no_tcp_connection)
     else:
-        print "You must provide at least one of -a, -c or -u option"
+        print("You must provide at least one of -a, -c or -u option")
         parser.print_usage()
         import sys
         sys.exit(1)