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

Mark Hammond python-dev@python.org
Thu, 27 Jul 2000 20:45:34 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv12371

Modified Files:
	test_winreg2.py 
Log Message:
Was quite broken and incomplete.  Now passes the test suite, but is still incomplete.

Index: test_winreg2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_winreg2.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_winreg2.py	2000/06/30 19:36:23	1.1
--- test_winreg2.py	2000/07/28 03:45:32	1.2
***************
*** 2,5 ****
--- 2,6 ----
  import sys, traceback
  import time
+ import array
  
  def testHives():
***************
*** 128,131 ****
--- 129,139 ----
      assert not hives["HKCU"].getValues().has_key( "Blah" )
  
+     # Ensure Unicode works as we expect
+     hives["HKCU"].setValue( u"Blah", u"abc" )
+     assert hives["HKCU"].getValueData( "Blah" )=="abc"
+     assert hives["HKCU"].getValues().has_key( u"Blah" )
+     del hives["HKCU"].getValues()[ u"Blah" ]
+     assert not hives["HKCU"].getValues().has_key( u"Blah" )
+ 
  def testDeleteValue():
      hives["HKCU"].setValue( "Blah", "abc" )
***************
*** 176,181 ****
      assert key.getValues()[ "abcd" ][1]==5
      key.deleteValue( "abcd" )
!     key.deleteKey( "HKLM\\Software\\a\\b")
!     key.deleteKey( "HKLM\\Software\\a")
  
  def testSetBinaryValue(): 
--- 184,189 ----
      assert key.getValues()[ "abcd" ][1]==5
      key.deleteValue( "abcd" )
!     deleteKey( "HKLM\\Software\\a\\b")
!     deleteKey( "HKLM\\Software\\a")
  
  def testSetBinaryValue(): 
***************
*** 184,190 ****
      key.setValue( "abcde", array.array( 'c', "PPPPPPPPPPPPPPP"), 
                         regtypes["REG_BINARY"] )
!     assert key.getValues()["abcd"]==key.getValues()["abcde"]
!     key.deleteKey( "HKLM\\Software\\a\\b")
!     key.deleteKey( "HKLM\\Software\\a")
  
  def testSetNone(): pass
--- 192,199 ----
      key.setValue( "abcde", array.array( 'c', "PPPPPPPPPPPPPPP"), 
                         regtypes["REG_BINARY"] )
!     assert key.getValues()["abcd"][1]==key.getValues()["abcde"][1]
!     key = None # Remove our reference.
!     deleteKey( "HKLM\\Software\\a\\b")
!     deleteKey( "HKLM\\Software\\a")
  
  def testSetNone(): pass