Browse Source

[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
Naoki Kambe 13 years ago
parent
commit
84d9095c66
1 changed files with 1 additions and 18 deletions
  1. 1 18
      src/bin/stats/tests/b10-stats-httpd_test.py

+ 1 - 18
src/bin/stats/tests/b10-stats-httpd_test.py

@@ -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):