Exemplo n.º 1
0
class TestCommand(TestCase):
    layer = Layer(bases=(TEMP_DIRECTORY_FIXTURE, MOCK_PYPI_FIXTURE),
                  name='test_command:TestCommand:layer')

    def setUp(self):
        self.tempdir = self.layer[u'tempdir']

    def test(self):
        self.layer['pypi'] = {
            'requests': '2.3.0',
            'setuptools': '0.7',
            'zope.component': '4.2.1',
            'zope.interface': '5.0.0',
            'zope.annotation': '4.2.0'
        }

        fshelpers.create_structure(self.tempdir,
                                   {'versions.cfg': VERSIONS_CONFIG})

        output = StringIO()
        with capture_streams(output):
            main(buildout_dir=self.tempdir,
                 versions='versions.cfg',
                 blacklists=(BLACKLIST_URL, ),
                 blacklist_packages=('zope.annotation', ))

        self.assertMultiLineEqual(
            '\n'.join((
                '[versions]',
                'requests = 2.3.0                         # was 2.0.0',
                # 'setuptools = 0.6c11',  # blacklisted
                # 'zope.component = 4.2.1',   # no new version
                'zope.interface = 5.0.0                   # was 4.1.0',
            )),
            output.getvalue().strip())
    defaultBases = (PLONE_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        """Set up Zope for testing."""
        # Load ZCML
        import customer.diazo.mlscr_com
        xmlconfig.file('configure.zcml',
                       customer.diazo.mlscr_com,
                       context=configurationContext)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'customer.diazo.mlscr_com:default')


CUSTOMER_DIAZO_MLSCR_COM_FIXTURE = CustomerDiazoMlscrComLayer()

CUSTOMER_DIAZO_MLSCR_COM_INTEGRATION_TESTING = IntegrationTesting(
    bases=(CUSTOMER_DIAZO_MLSCR_COM_FIXTURE, ),
    name='CustomerDiazoMlscrComLayer:IntegrationTesting')

CUSTOMER_DIAZO_MLSCR_COM_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(CUSTOMER_DIAZO_MLSCR_COM_FIXTURE, ),
    name='CustomerDiazoMlscrComLayer:FunctionalTesting')

CUSTOMER_DIAZO_MLSCR_COM_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(CUSTOMER_DIAZO_MLSCR_COM_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE,
           z2.ZSERVER_FIXTURE),
    name='CustomerDiazoMlscrComLayer:AcceptanceTesting')

ROBOT_TESTING = Layer(name='customer.diazo.mlscr_com:Robot')
Exemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     Layer.__init__(self, *args, **kwargs)
     self._engine = None
     self._session = None
     self.auto_commit = False
Exemplo n.º 4
0
        """Set up Zope for testing."""
        # Load ZCML
        import plone.app.mosaic
        self.loadZCML(package=plone.app.mosaic)
        import pkan.tiles
        self.loadZCML(package=pkan.tiles)

    def setUpPloneSite(self, portal):
        """Set up a Plone site for testing."""
        self.applyProfile(portal, 'plone.app.mosaic:default')
        self.applyProfile(portal, 'pkan.tiles:default')


FIXTURE = Fixture()
INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE, ),
    name='pkan.tiles:Integration',
)

FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE, z2.ZSERVER_FIXTURE),
    name='pkan.tiles:Functional',
)

ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE),
    name='pkan.tiles:Acceptance',
)

ROBOT_TESTING = Layer(name='pkan.tiles:Robot')
        """Set up Zope for testing."""
        # Load ZCML
        import plone.app.mosaic
        self.loadZCML(package=plone.app.mosaic)
        import collective.tiles.githubgist
        self.loadZCML(package=collective.tiles.githubgist)

    def setUpPloneSite(self, portal):
        """Set up a Plone site for testing."""
        self.applyProfile(portal, 'plone.app.mosaic:default')
        self.applyProfile(portal, 'collective.tiles.githubgist:default')


FIXTURE = Fixture()
INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE, ),
    name='collective.tiles.githubgist:Integration',
)

FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE, z2.ZSERVER_FIXTURE),
    name='collective.tiles.githubgist:Functional',
)

ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE),
    name='collective.tiles.githubgist:Acceptance',
)

ROBOT_TESTING = Layer(name='collective.tiles.githubgist:Robot')
Exemplo n.º 6
0
FIXTURE = PloneWithPackageLayer(
    zcml_package=Products.LoginLockout,
    zcml_filename='configure.zcml',
    gs_profile_id='Products.LoginLockout:default',
    name="LoginLockoutFixture",
)

INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE, ),
    name='Products.LoginLockout:Integration',
)
FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE, ZSERVER_FIXTURE),
    name='Products.LoginLockout:Functional',
)
ROBOT_TESTING = Layer(name='Products.LoginLockout:Robot')


def setUp(doctest):
    layer = doctest.globs['layer']
    app = layer['app']
    portal = layer['portal']
    anon_browser = Browser(app)
    admin_browser = Browser(app)
    admin_browser.addHeader('Authorization', 'Basic admin:secret')
    admin_browser.open(portal.absolute_url())

    user_id = TEST_USER_NAME
    user_password = TEST_USER_PASSWORD

    def config_property(**kw):
Exemplo n.º 7
0
        """Set up Zope for testing."""
        # Load ZCML
        import plone.app.mosaic
        self.loadZCML(package=plone.app.mosaic)
        import collective.tiles.sliders
        self.loadZCML(package=collective.tiles.sliders)

    def setUpPloneSite(self, portal):
        self.applyProfile(portal, 'plone.app.mosaic:default')
        self.applyProfile(portal, 'collective.tiles.sliders:default')


FIXTURE = Fixture()

INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE, ),
    name='collective.tiles.sliders:Integration',
)

FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE, z2.ZSERVER_FIXTURE),
    name='collective.tiles.sliders:Functional',
)

ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE),
    name='collective.tiles.sliders:Acceptance',
)

ROBOT_TESTING = Layer(name='collective.tiles.sliders:Robot')
Exemplo n.º 8
0
    def setUpPloneSite(self, portal):
        applyProfile(portal, 'ps.plone.realestatefont:default')


PS_PLONE_REALESTATEFONT_FIXTURE = PsPloneRealestatefontLayer()


PS_PLONE_REALESTATEFONT_INTEGRATION_TESTING = IntegrationTesting(
    bases=(PS_PLONE_REALESTATEFONT_FIXTURE,),
    name='PsPloneRealestatefontLayer:IntegrationTesting'
)


PS_PLONE_REALESTATEFONT_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(PS_PLONE_REALESTATEFONT_FIXTURE,),
    name='PsPloneRealestatefontLayer:FunctionalTesting'
)


PS_PLONE_REALESTATEFONT_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(
        PS_PLONE_REALESTATEFONT_FIXTURE,
        REMOTE_LIBRARY_BUNDLE_FIXTURE,
        z2.ZSERVER_FIXTURE
    ),
    name='PsPloneRealestatefontLayer:AcceptanceTesting'
)


ROBOT_TESTING = Layer(name='ps.plone.realestatefont:Robot')
    """Custom Test Layer for customer.diazo.flamingocostarica_com."""
    defaultBases = (PLONE_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        """Set up Zope for testing."""
        # Load ZCML
        import customer.diazo.flamingocostarica_com
        self.loadZCML(package=customer.diazo.flamingocostarica_com)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'customer.diazo.flamingocostarica_com:default')


CUSTOMER_DIAZO_FLAMINGOCOSTARICA_COM_FIXTURE = \
    CustomerDiazoFlamingocostaricaComLayer()

CUSTOMER_DIAZO_FLAMINGOCOSTARICA_COM_INTEGRATION_TESTING = IntegrationTesting(
    bases=(CUSTOMER_DIAZO_FLAMINGOCOSTARICA_COM_FIXTURE, ),
    name='CustomerDiazoFlamingocostaricaComLayer:IntegrationTesting')

CUSTOMER_DIAZO_FLAMINGOCOSTARICA_COM_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(CUSTOMER_DIAZO_FLAMINGOCOSTARICA_COM_FIXTURE, ),
    name='CustomerDiazoFlamingocostaricaComLayer:FunctionalTesting')

CUSTOMER_DIAZO_FLAMINGOCOSTARICA_COM_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(CUSTOMER_DIAZO_FLAMINGOCOSTARICA_COM_FIXTURE,
           REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE),
    name='CustomerDiazoFlamingocostaricaComLayer:AcceptanceTesting')

ROBOT_TESTING = Layer(name='customer.diazo.flamingocostarica_com:Robot')
Exemplo n.º 10
0
 def __init__(self):
     Layer.__init__(self)
Exemplo n.º 11
0
    defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        """Set up Zope for testing."""
        # Load ZCML
        import plonetheme.barcelonetang
        self.loadZCML(package=plonetheme.barcelonetang)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'plonetheme.barcelonetang:default')
        applyProfile(portal, 'plone.app.contenttypes:plone-content')
        applyProfile(portal, 'plonetheme.barcelonetang:testfixture')


PLONETHEME_BARCELONETANG_FIXTURE = PlonethemeBarcelonetangLayer()

PLONETHEME_BARCELONETANG_INTEGRATION_TESTING = IntegrationTesting(
    bases=(PLONETHEME_BARCELONETANG_FIXTURE, ),
    name='PlonethemeBarcelonetangLayer:IntegrationTesting')

PLONETHEME_BARCELONETANG_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(PLONETHEME_BARCELONETANG_FIXTURE, ),
    name='PlonethemeBarcelonetangLayer:FunctionalTesting')

PLONETHEME_BARCELONETANG_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(PLONETHEME_BARCELONETANG_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE,
           z2.ZSERVER_FIXTURE),
    name='PlonethemeBarcelonetangLayer:AcceptanceTesting')

ROBOT_TESTING = Layer(name='plonetheme.barcelonetang:Robot')
Exemplo n.º 12
0
    defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        """Set up Zope for testing."""
        # Load ZCML
        import plone.formwidget.relateditems
        self.loadZCML(package=plone.formwidget.relateditems)

    def setUpPloneSite(self, portal):
        self.applyProfile(portal, 'plone.formwidget.relateditems:default')


FIXTURE = Fixture()

INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE, ),
    name='plone.formwidget.relateditems:Integration',
)

FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE, z2.ZSERVER_FIXTURE),
    name='plone.formwidget.relateditems:Functional',
)

ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE),
    name='plone.formwidget.relateditems:Acceptance',
)

ROBOT_TESTING = Layer(name='plone.formwidget.relateditems:Robot')
Exemplo n.º 13
0
 def __init__(self, *args, **kwargs):
     Layer.__init__(self, *args, **kwargs)
     self._engine = None
     self._session = None
Exemplo n.º 14
0
    def setUpZope(self, app, configurationContext):
        """Set up Zope for testing."""
        # Load ZCML
        import customer.diazo.puntacentinela_com_ec
        xmlconfig.file('configure.zcml',
                       customer.diazo.puntacentinela_com_ec,
                       context=configurationContext)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'customer.diazo.puntacentinela_com_ec:default')


CUSTOMER_DIAZO_PUNTACENTINELA_COM_EC_FIXTURE = CustomerDiazoPuntacentinelaComEcLayer(
)

CUSTOMER_DIAZO_PUNTACENTINELA_COM_EC_INTEGRATION_TESTING = IntegrationTesting(
    bases=(CUSTOMER_DIAZO_PUNTACENTINELA_COM_EC_FIXTURE, ),
    name='CustomerDiazoPuntacentinelaComEcLayer:IntegrationTesting')

CUSTOMER_DIAZO_PUNTACENTINELA_COM_EC_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(CUSTOMER_DIAZO_PUNTACENTINELA_COM_EC_FIXTURE, ),
    name='CustomerDiazoPuntacentinelaComEcLayer:FunctionalTesting')

CUSTOMER_DIAZO_PUNTACENTINELA_COM_EC_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(CUSTOMER_DIAZO_PUNTACENTINELA_COM_EC_FIXTURE,
           REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE),
    name='CustomerDiazoPuntacentinelaComEcLayer:AcceptanceTesting')

ROBOT_TESTING = Layer(name='customer.diazo.puntacentinela_com_ec:Robot')
Exemplo n.º 15
0
    def setUpZope(self, app, configurationContext):
        """Set up Zope for testing."""
        # Load ZCML
        import pkan.widgets
        self.loadZCML(package=pkan.widgets)

    def setUpPloneSite(self, portal):
        self.applyProfile(portal, 'pkan.widgets:default')


FIXTURE = Fixture()

INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE, ),
    name='pkan.widgets:Integration',
)

FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE, z2.ZSERVER_FIXTURE),
    name='pkan.widgets:Functional',
)


ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE),
    name='pkan.widgets:Acceptance',
)

ROBOT_TESTING = Layer(name='pkan.widgets:Robot')
Exemplo n.º 16
0
 def __init__(self):
     Layer.__init__(self)
Exemplo n.º 17
0
        sm.registerUtility(mailhost, provided=IMailHost)


FIXTURE = Fixture()
INTEGRATION_TESTING = IntegrationTesting(
    bases=(FIXTURE,),
    name='collective.easyform:Integration',
)
FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(FIXTURE,),
    name='collective.easyform:Functional',
)
ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(FIXTURE, AUTOLOGIN_LIBRARY_FIXTURE, ZSERVER_FIXTURE),
    name='collective.easyform:Acceptance')
ROBOT_TESTING = Layer(name='collective.easyform:Robot')


class EasyFormTestCase(TestCase):

    layer = INTEGRATION_TESTING

    def setUp(self):
        self.app = self.layer['app']
        self.portal = self.layer['portal']
        self.portal.invokeFactory('Folder', 'test-folder')
        self.folder = self.portal['test-folder']
        self.afterSetUp()

    def afterSetUp(self):
        pass
Exemplo n.º 18
0
    defaultBases = (PLONE_FIXTURE, )

    def setUpZope(self, app, configurationContext):
        """Set up Zope for testing."""
        # Load ZCML
        import ps.diazo.mlsnica
        xmlconfig.file('configure.zcml',
                       ps.diazo.mlsnica,
                       context=configurationContext)

    def setUpPloneSite(self, portal):
        applyProfile(portal, 'ps.diazo.mlsnica:default')


PS_DIAZO_MLSNICA_FIXTURE = PsDiazoMlsnicaLayer()

PS_DIAZO_MLSNICA_INTEGRATION_TESTING = IntegrationTesting(
    bases=(PS_DIAZO_MLSNICA_FIXTURE, ),
    name='PsDiazoMlsnicaLayer:IntegrationTesting')

PS_DIAZO_MLSNICA_FUNCTIONAL_TESTING = FunctionalTesting(
    bases=(PS_DIAZO_MLSNICA_FIXTURE, ),
    name='PsDiazoMlsnicaLayer:FunctionalTesting')

PS_DIAZO_MLSNICA_ACCEPTANCE_TESTING = FunctionalTesting(
    bases=(PS_DIAZO_MLSNICA_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE,
           z2.ZSERVER_FIXTURE),
    name='PsDiazoMlsnicaLayer:AcceptanceTesting')

ROBOT_TESTING = Layer(name='ps.diazo.mlsnica:Robot')