Commit 84d9095c authored by Naoki Kambe's avatar Naoki Kambe
Browse files

[trac930] modify b10-stats-httpd_test.py

 - increase seconds in sleep time which is before HTTP client connects
   to the server

 - delete 'test_log_message' because of the deletion of original
   function
parent e54bc83c
......@@ -68,7 +68,7 @@ class TestHttpHandler(unittest.TestCase):
self.assertTrue(type(self.stats_httpd.httpd) is list)
self.assertEqual(len(self.stats_httpd.httpd), 0)
statshttpd_server.run()
time.sleep(TIMEOUT_SEC*5)
time.sleep(TIMEOUT_SEC*8)
client = http.client.HTTPConnection(address, port)
client._http_vsn_str = 'HTTP/1.0\n'
client.connect()
......@@ -249,23 +249,6 @@ class TestHttpHandler(unittest.TestCase):
client.close()
statshttpd_server.shutdown()
def test_log_message(self):
class MyHttpHandler(stats_httpd.HttpHandler):
def __init__(self):
class _Dummy_class_(): pass
self.address_string = lambda : 'dummyhost'
self.log_date_time_string = lambda : \
'DD/MM/YYYY HH:MI:SS'
self.server = _Dummy_class_()
self.server.log_writer = self.log_writer
def log_writer(self, line):
self.logged_line = line
self.handler = MyHttpHandler()
self.handler.log_message("%s %d", 'ABCDEFG', 12345)
self.assertEqual(self.handler.logged_line,
"[b10-stats-httpd] dummyhost - - "
+ "[DD/MM/YYYY HH:MI:SS] ABCDEFG 12345\n")
class TestHttpServerError(unittest.TestCase):
"""Tests for HttpServerError exception"""
def test_raises(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment