[Python-checkins] CVS: python/dist/src/Lib/test test_hotshot.py,1.4,1.5

Fred L. Drake fdrake@users.sourceforge.net
Mon, 29 Oct 2001 12:54:04 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv14012/Lib/test

Modified Files:
	test_hotshot.py 
Log Message:
Add a test for the insertion of user-provided ADD_INFO records.

Index: test_hotshot.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_hotshot.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** test_hotshot.py	2001/10/18 19:34:00	1.4
--- test_hotshot.py	2001/10/29 20:54:01	1.5
***************
*** 42,47 ****
  
      def get_logreader(self):
!         log = UnlinkingLogReader(self.logfn)
!         return log
  
      def get_events_wotime(self):
--- 42,46 ----
  
      def get_logreader(self):
!         return UnlinkingLogReader(self.logfn)
  
      def get_events_wotime(self):
***************
*** 68,71 ****
--- 67,81 ----
          profiler.close()
          self.check_events(events)
+ 
+     def test_addinfo(self):
+         def f(p):
+             p.addinfo("test-key", "test-value")
+         profiler = self.new_profiler()
+         profiler.runcall(f, profiler)
+         profiler.close()
+         log = self.get_logreader()
+         info = log._info
+         list(log)
+         self.failUnless(info["test-key"] == ["test-value"])
  
      def test_line_numbers(self):