[Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.119,1.120

Guido van Rossum gvanrossum@users.sourceforge.net
Tue, 12 Mar 2002 12:43:34 -0800


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

Modified Files:
	test_descr.py 
Log Message:
Test for the fix I just checked in to moduleobject.c.

Bugfix candidate.


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.119
retrieving revision 1.120
diff -C2 -d -r1.119 -r1.120
*** test_descr.py	11 Mar 2002 14:44:12 -0000	1.119
--- test_descr.py	12 Mar 2002 20:43:31 -0000	1.120
***************
*** 2731,2734 ****
--- 2731,2745 ----
      z = deepcopy(a) # This blew up before
  
+ def modules():
+     if verbose: print "Testing uninitialized module objects..."
+     from types import ModuleType as M
+     m = M.__new__(M)
+     str(m)
+     vereq(hasattr(m, "__name__"), 0)
+     vereq(hasattr(m, "__file__"), 0)
+     vereq(hasattr(m, "foo"), 0)
+     vereq(m.__dict__, None)
+     m.foo = 1
+     vereq(m.__dict__, {"foo": 1})
  
  def test_main():
***************
*** 2787,2790 ****
--- 2798,2802 ----
      strops()
      deepcopyrecursive()
+     modules()
      if verbose: print "All OK"