[Python-checkins] CVS: python/dist/src/Lib/test test_pyclbr.py,1.1,1.2

Tim Peters tim_one@users.sourceforge.net
Mon, 13 Aug 2001 15:25:26 -0700


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

Modified Files:
	test_pyclbr.py 
Log Message:
Repair Unix-specific assumptions that caused this to fail on Windows.


Index: test_pyclbr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pyclbr.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_pyclbr.py	2001/08/13 20:26:19	1.1
--- test_pyclbr.py	2001/08/13 22:25:24	1.2
***************
*** 10,16 ****
  # This next line triggers an error on old versions of pyclbr.
  
! from commands import getstatus 
  
! # Here we test the python class browser code.  
  #
  # The main function in this suite, 'testModule', compares the output
--- 10,16 ----
  # This next line triggers an error on old versions of pyclbr.
  
! from commands import getstatus
  
! # Here we test the python class browser code.
  #
  # The main function in this suite, 'testModule', compares the output
***************
*** 28,33 ****
                  if not ok:
                      self.fail("%r missing" % item)
!         
!  
      def assertHasattr(self, obj, attr, ignore):
          ''' succeed iff hasattr(obj,attr) or attr in ignore. '''
--- 28,33 ----
                  if not ok:
                      self.fail("%r missing" % item)
! 
! 
      def assertHasattr(self, obj, attr, ignore):
          ''' succeed iff hasattr(obj,attr) or attr in ignore. '''
***************
*** 56,60 ****
  
          if module == None:
!             module = __import__(moduleName, globals(), {}, [])      
  
          dict = pyclbr.readmodule_ex(moduleName)
--- 56,60 ----
  
          if module == None:
!             module = __import__(moduleName, globals(), {}, [])
  
          dict = pyclbr.readmodule_ex(moduleName)
***************
*** 62,66 ****
          # Make sure the toplevel functions and classes are the same.
          for name, value in dict.items():
!             if name in ignore: 
                  continue
              self.assertHasattr(module, name, ignore)
--- 62,66 ----
          # Make sure the toplevel functions and classes are the same.
          for name, value in dict.items():
!             if name in ignore:
                  continue
              self.assertHasattr(module, name, ignore)
***************
*** 71,77 ****
                  self.assertEquals(type(py_item), ClassType)
                  real_bases = [base.__name__ for base in py_item.__bases__]
!                 pyclbr_bases = [ getattr(base, 'name', base) 
                                   for base in value.super ]
!                                    
                  self.assertListEq(real_bases, pyclbr_bases, ignore)
  
--- 71,77 ----
                  self.assertEquals(type(py_item), ClassType)
                  real_bases = [base.__name__ for base in py_item.__bases__]
!                 pyclbr_bases = [ getattr(base, 'name', base)
                                   for base in value.super ]
! 
                  self.assertListEq(real_bases, pyclbr_bases, ignore)
  
***************
*** 120,124 ****
  
          cm('urllib', ignore=('getproxies_environment', # set with =
!                              'getproxies_registry'))   # set with =
  
          #XXXX bad example
--- 120,125 ----
  
          cm('urllib', ignore=('getproxies_environment', # set with =
!                              'getproxies_registry',    # set with =
!                              'open_https'))            # not on all platforms
  
          #XXXX bad example
***************
*** 130,158 ****
  
  
!         
          cm('pickle', ignore=('g',))       # deleted declaration
!         
          cm('aifc', ignore=('openfp',))    # set with =
-         
-         cm('httplib', ignore=('error',))  # set with =
  
  
          cm('Cookie', ignore=('__str__', 'Cookie')) # set with =
!         
          cm('sre_parse', ignore=('literal', # nested def
                                  'makedict', 'dump' # from sre_constants
                                  ))
  
!         cm('test.test_pyclbr', 
             module=sys.modules[__name__])
  
          # pydoc doesn't work because of string issues
          # cm('pydoc', pydoc)
!         
          # pdb plays too many dynamic games
!         # cm('pdb', pdb) 
  
  run_unittest(PyclbrTest)
- 
- 
- 
--- 131,156 ----
  
  
! 
          cm('pickle', ignore=('g',))       # deleted declaration
! 
          cm('aifc', ignore=('openfp',))    # set with =
  
+         cm('httplib', ignore=('error',    # set with =
+                               'HTTPS'))   # not on all platforms
  
          cm('Cookie', ignore=('__str__', 'Cookie')) # set with =
! 
          cm('sre_parse', ignore=('literal', # nested def
                                  'makedict', 'dump' # from sre_constants
                                  ))
  
!         cm('test.test_pyclbr',
             module=sys.modules[__name__])
  
          # pydoc doesn't work because of string issues
          # cm('pydoc', pydoc)
! 
          # pdb plays too many dynamic games
!         # cm('pdb', pdb)
  
  run_unittest(PyclbrTest)