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
41b687a5
Commit
41b687a5
authored
Jul 21, 2003
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken test that depended on Startup module having getSchema.
parent
3d5aa9a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
lib/python/Zope/Startup/tests/test_schema.py
lib/python/Zope/Startup/tests/test_schema.py
+15
-3
No files found.
lib/python/Zope/Startup/tests/test_schema.py
View file @
41b687a5
...
@@ -30,14 +30,26 @@ from App.config import getConfiguration
...
@@ -30,14 +30,26 @@ from App.config import getConfiguration
TEMPNAME
=
tempfile
.
mktemp
()
TEMPNAME
=
tempfile
.
mktemp
()
TEMPPRODUCTS
=
os
.
path
.
join
(
TEMPNAME
,
"Products"
)
TEMPPRODUCTS
=
os
.
path
.
join
(
TEMPNAME
,
"Products"
)
try
:
__file__
except
NameError
:
import
sys
__file__
=
sys
.
argv
[
0
]
def
getSchema
():
startup
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
))
schemafile
=
os
.
path
.
join
(
startup
,
'zopeschema.xml'
)
return
ZConfig
.
loadSchema
(
schemafile
)
class
StartupTestCase
(
unittest
.
TestCase
):
class
StartupTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
schema
=
getSchema
()
def
load_config_text
(
self
,
text
):
def
load_config_text
(
self
,
text
):
# We have to create a directory of our own since the existence
# We have to create a directory of our own since the existence
# of the directory is checked. This handles this in a
# of the directory is checked. This handles this in a
# platform-independent way.
# platform-independent way.
schema
=
Zope
.
Startup
.
getSchema
()
schema
=
self
.
schema
sio
=
cStringIO
.
StringIO
(
sio
=
cStringIO
.
StringIO
(
text
.
replace
(
"<<INSTANCE_HOME>>"
,
TEMPNAME
))
text
.
replace
(
"<<INSTANCE_HOME>>"
,
TEMPNAME
))
os
.
mkdir
(
TEMPNAME
)
os
.
mkdir
(
TEMPNAME
)
...
@@ -51,7 +63,7 @@ class StartupTestCase(unittest.TestCase):
...
@@ -51,7 +63,7 @@ class StartupTestCase(unittest.TestCase):
return
conf
return
conf
def
test_load_config_template
(
self
):
def
test_load_config_template
(
self
):
schema
=
Zope
.
Startup
.
getSchema
()
schema
=
self
.
schema
cfg
=
getConfiguration
()
cfg
=
getConfiguration
()
fn
=
os
.
path
.
join
(
cfg
.
zopehome
,
"skel"
,
"etc"
,
"zope.conf.in"
)
fn
=
os
.
path
.
join
(
cfg
.
zopehome
,
"skel"
,
"etc"
,
"zope.conf.in"
)
f
=
open
(
fn
)
f
=
open
(
fn
)
...
...
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