Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
07faa773
Commit
07faa773
authored
Jun 27, 2010
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for DatabaseOpened events
parent
e8f7894e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
src/Zope2/App/tests/test_startup.py
src/Zope2/App/tests/test_startup.py
+43
-0
No files found.
src/Zope2/App/tests/test_startup.py
0 → 100644
View file @
07faa773
##############################################################################
#
# Copyright (c) 2010 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (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.
#
##############################################################################
import
logging
from
Testing.ZopeTestCase
import
ZopeTestCase
from
zope.testing.loggingsupport
import
InstalledHandler
logged
=
"""Zope2.App.test_startup INFO
<class 'zope.processlifetime.DatabaseOpened'>
Zope2.App.test_startup INFO
<class 'zope.processlifetime.DatabaseOpenedWithRoot'>"""
def
logevent
(
event
):
logger
=
logging
.
getLogger
(
'Zope2.App.test_startup'
)
logger
.
info
(
event
.
__class__
)
class
StartupTests
(
ZopeTestCase
):
def
test_dummy
(
self
):
from
Zope2.App.startup
import
startup
from
zope.component
import
provideHandler
from
zope.processlifetime
import
IDatabaseOpened
from
zope.processlifetime
import
IDatabaseOpenedWithRoot
handler
=
InstalledHandler
(
'Zope2.App.test_startup'
)
provideHandler
(
logevent
,
[
IDatabaseOpenedWithRoot
])
provideHandler
(
logevent
,
[
IDatabaseOpened
])
startup
()
self
.
assertEqual
(
str
(
handler
),
logged
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment