[Zope3-checkins] CVS: Zope3/src/zope/products/file/ftests - __init__.py:1.1.2.1 test_file.py:1.1.2.1

Philipp von Weitershausen philikon at philikon.de
Wed Feb 11 11:29:22 EST 2004


Update of /cvs-repository/Zope3/src/zope/products/file/ftests
In directory cvs.zope.org:/tmp/cvs-serv21715/file/ftests

Added Files:
      Tag: philikon-movecontent-branch
	__init__.py test_file.py 
Log Message:
Get rid of zope.products.content and zope.products.codecontent and move
content components in their own packages at zope.products.

See the package geddon proposal: http://dev.zope.org/Zope3/PackageGeddon


=== Added File Zope3/src/zope/products/file/ftests/__init__.py ===
#
# This file is necessary to make this directory a package.


=== Added File Zope3/src/zope/products/file/ftests/test_file.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""

$Id: test_file.py,v 1.1.2.1 2004/02/11 16:29:20 philikon Exp $
"""

import unittest

from zope.testing.functional import BrowserTestCase


class TestFile(BrowserTestCase):

    def testAddFile(self):
        # Step 1: add the file
        response = self.publish('/+/action.html',
                                basic='mgr:mgrpw',
                                form={'type_name': u'File', 'id': u'foo'})
        self.assertEqual(response.getStatus(), 302)
        self.assertEqual(response.getHeader('Location'),
                         'http://localhost/@@contents.html')
        # Step 2: check that it it visible in the folder listing
        response = self.publish('/')
        self.assertEqual(response.getStatus(), 200)
        self.assert_(response.getBody().find('foo') != -1)
        # Step 3: check that its contents are available
        response = self.publish('/foo')
        self.assertEqual(response.getStatus(), 200)


def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestFile))
    return suite

if __name__=='__main__':
    unittest.main(defaultTest='test_suite')




More information about the Zope3-Checkins mailing list