[Python-checkins] r51616 - python/branches/hoxworth-stdlib_logging-soc/pep_update.txt python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py

jackilyn.hoxworth python-checkins at python.org
Fri Aug 25 18:06:00 CEST 2006


Author: jackilyn.hoxworth
Date: Fri Aug 25 18:05:59 2006
New Revision: 51616

Added:
   python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py
Modified:
   python/branches/hoxworth-stdlib_logging-soc/pep_update.txt
Log:


Modified: python/branches/hoxworth-stdlib_logging-soc/pep_update.txt
==============================================================================
--- python/branches/hoxworth-stdlib_logging-soc/pep_update.txt	(original)
+++ python/branches/hoxworth-stdlib_logging-soc/pep_update.txt	Fri Aug 25 18:05:59 2006
@@ -1,21 +1,21 @@
-Modifications to the Original Proposal
-- the import is delayed until it's need
-
-Module Checklist
-BaseHTTPServer.py - done but no test case created
-SocketServer.py - done but no test case created
-asyncore.py - done
-gopherlib.py - done but no test case created
-httplib - done with a test case almost completed
-ihooks.py - done but no test case created
-imaplib.py - done but no test case created
-mhlib.py - done but no test case created
-nntplib.py - done but no test case created
-pipes.py - done but no test case created
-pkgutil.py  - done but no test case created
-robotparser.py - done but no test case created
-shlex.py - done but no test case created
-smtpd.py - done but no test case created
-threading.py - done but no test case created
-timeit.py - done but no test case created
+Modifications to the Original Proposal
+- the import is delayed until it's need
+
+Module Checklist
+BaseHTTPServer.py - done but no test case created
+SocketServer.py - done but no test case created
+asyncore.py - done
+gopherlib.py - done but no test case created
+httplib - done with a test case almost completed
+ihooks.py - done but no test case created
+imaplib.py - done but no test case created
+mhlib.py - done but no test case created
+nntplib.py - done but no test case created
+pipes.py - done but no test case created
+pkgutil.py  - done but no test case created
+robotparser.py - done
+shlex.py - done but no test case created
+smtpd.py - done but no test case created
+threading.py - done but no test case created
+timeit.py - done but no test case created
 trace.py - done but no test case created
\ No newline at end of file

Added: python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py
==============================================================================
--- (empty file)
+++ python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py	Fri Aug 25 18:05:59 2006
@@ -0,0 +1,23 @@
+import robotparser
+import logging
+from cStringIO import StringIO
+
+# ... run the tests ...
+log=logging.getLogger("py.robotparser")
+stringLog = StringIO()
+
+# define the handler and level
+handler = logging.StreamHandler(stringLog)
+log.setLevel(logging.INFO)
+
+# add the handler to the logger
+log.addHandler(handler)
+
+robotparser._log.info("message 1") # 1st test
+
+print stringLog.getvalue()  # For testing purposes
+
+if stringLog.getvalue() != "Error:  It worked":
+    print "it worked"
+else:
+    print "it didn't work"
\ No newline at end of file


More information about the Python-checkins mailing list