CVS: Products/Zelenium/tests - test_zuite.py:1.3

Tres Seaver <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
Update of /cvs-repository/Products/Zelenium/tests
In directory cvs.zope.org:/tmp/cvs-serv5722/tests

Modified Files:
	test_zuite.py 
Log Message:
 - Add unit tests for Zuite.__getitem__ behavior, including support files.


=== Products/Zelenium/tests/test_zuite.py 1.2 => 1.3 ===
--- Products/Zelenium/tests/test_zuite.py:1.2	Wed May  4 11:24:35 2005
+++ Products/Zelenium/tests/test_zuite.py	Sat May  7 15:03:58 2005
@@ -3,6 +3,7 @@
 $Id$
 """
 import unittest
+
 try:
     import Zope2
 except ImportError:
@@ -123,6 +124,35 @@
         self.failUnless( 'File' in zuite.test_case_metatypes )
         self.failUnless( 'Page Template' in zuite.test_case_metatypes )
         self.assertEqual( len( zuite.listTestCases() ), 0 )
+
+    def test___getitem___normal( self ):
+
+        from Acquisition import aq_base
+
+        _KEY = 'key'
+        zuite = self._makeOne()
+
+        try:
+            object = zuite[ _KEY ]
+        except KeyError:
+            pass
+        else:
+            assert 0, "__getitem__ didn't raise: %s" % _KEY
+
+        zuite._setObject( _KEY, self._makeFile( _KEY ) )
+        object = zuite[ _KEY ]
+        self.failUnless( aq_base( object )
+                      is aq_base( getattr( zuite, _KEY ) ) )
+
+    def test___getitem___support_files( self ):
+
+        from Products.Zelenium.zuite import _SUPPORT_FILE_NAMES
+
+        zuite = self._makeOne()
+
+        for name in _SUPPORT_FILE_NAMES:
+            object = zuite[ name ]
+            self.assertEqual( object.meta_type, 'File' )
 
     def test_listTestCases_simple( self ):
 

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.