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

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-serv29020/tests

Modified Files:
	test_zuite.py 
Log Message:
 - Allow suppression of Selenium files from archive.


=== Products/Zelenium/tests/test_zuite.py 1.5 => 1.6 ===
--- Products/Zelenium/tests/test_zuite.py:1.5	Mon May  9 14:50:29 2005
+++ Products/Zelenium/tests/test_zuite.py	Mon May  9 15:05:06 2005
@@ -117,14 +117,17 @@
         for lhs, rhs in zip( manifest, contents ):
             self.assertEqual( lhs, rhs )
 
-    def _listDefaultArchiveNames( self ):
+    def _listDefaultArchiveNames( self, include_selenium=True ):
 
         from Products.Zelenium.zuite import _SUPPORT_FILES
 
-        expected_names = _SUPPORT_FILES.keys()
+        expected_names = []
         expected_names.append( 'index.html' )
         expected_names.append( 'testSuite.html' )
 
+        if include_selenium:
+            expected_names.extend( _SUPPORT_FILES.keys() )
+
         return expected_names
 
     def _makeFile( self, id, title=None, file=None ):
@@ -436,6 +439,31 @@
         self._verifyArchive( response._body, expected )
         self._verifyManifest( response._body, '.objects', [] )
 
+    def test_manage_getZipFile_empty_no_selenium( self ):
+
+        _ID = 'mgzf_empty'
+        _ARCHIVE_NAME = 'empty.zip'
+
+        response = DummyResponse()
+        zuite = self._makeOne( _ID ).__of__( self.root )
+
+        zuite.manage_getZipFile( archive_name=_ARCHIVE_NAME
+                               , include_selenium=False
+                               , RESPONSE=response
+                               )
+
+        self.assertEqual( response._headers[ 'Content-type' ]
+                        , 'application/zip' )
+        self.assertEqual( response._headers[ 'Content-disposition' ]
+                        , 'inline;filename=%s' % _ARCHIVE_NAME )
+        self.assertEqual( response._headers[ 'Content-length' ]
+                        , str( len( response._body ) ) )
+
+        expected = self._listDefaultArchiveNames( include_selenium=False )
+        expected.append( '.objects' )
+        self._verifyArchive( response._body, expected )
+        self._verifyManifest( response._body, '.objects', [] )
+
     def test_manage_getZipFile_default_name( self ):
 
         _ID = 'mgzf'
@@ -533,6 +561,24 @@
 
         archive = zuite._getOb( _ARCHIVE_NAME )
         expected = self._listDefaultArchiveNames()
+        expected.append( '.objects' )
+        self._verifyArchive( archive.data, expected )
+
+    def test_manage_createSnapshot_no_selenium( self ):
+
+        _ID = 'mcs_empty'
+        _ARCHIVE_NAME = 'empty.zip'
+        zuite = self._makeOne( _ID ).__of__( self.root )
+
+        zuite.manage_createSnapshot( archive_name=_ARCHIVE_NAME
+                                   , include_selenium=False
+                                   )
+        object_ids = zuite.objectIds()
+        self.assertEqual( len( object_ids ), 1 )
+        self.failUnless( _ARCHIVE_NAME in object_ids )
+
+        archive = zuite._getOb( _ARCHIVE_NAME )
+        expected = self._listDefaultArchiveNames( include_selenium=False )
         expected.append( '.objects' )
         self._verifyArchive( archive.data, expected )
 

_______________________________________________
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.