[Python-checkins] CVS: python/dist/src/Lib/test test_unicode.py,1.17,1.18

M.-A. Lemburg python-dev@python.org
Fri, 7 Jul 2000 06:46:22 -0700


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

Modified Files:
	test_unicode.py 
Log Message:
Tests for new instance support in unicode().

Index: test_unicode.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** test_unicode.py	2000/07/05 09:46:40	1.17
--- test_unicode.py	2000/07/07 13:46:19	1.18
***************
*** 299,302 ****
--- 299,317 ----
  assert unicode('hello','latin-1') == u'hello'
  
+ class String:
+     x = ''
+     def __str__(self):
+         return self.x
+ 
+ o = String()
+ 
+ o.x = 'abc'
+ assert unicode(o) == u'abc'
+ assert str(o) == 'abc'
+ 
+ o.x = u'abc'
+ assert unicode(o) == u'abc'
+ assert str(o) == 'abc'
+ 
  try:
      u'Andr\202 x'.encode('ascii')