Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zodburi
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
zodburi
Commits
d1580fde
Commit
d1580fde
authored
Apr 18, 2017
by
Jim Fulton
Committed by
GitHub
Apr 18, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16 from Pylons/fix-zconfig
Fixed: changes in 2.2 broke the zconfig resolver.
parents
2fe5ad0b
ba261a69
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
5 deletions
+31
-5
CHANGES.txt
CHANGES.txt
+1
-1
zodburi/__init__.py
zodburi/__init__.py
+5
-4
zodburi/tests/test_resolvers.py
zodburi/tests/test_resolvers.py
+25
-0
No files found.
CHANGES.txt
View file @
d1580fde
...
...
@@ -4,7 +4,7 @@
2.2.1 (unreleased)
------------------
-
Nothing changed yet
.
-
Fixed: changes in 2.2 broke the zconfig resolver
.
2.2 (2017-04-17)
...
...
zodburi/__init__.py
View file @
d1580fde
...
...
@@ -50,6 +50,7 @@ def _get_dbkw(kw):
if parameter in kw:
v = kw.pop(parameter)
if parameter.startswith('
connection_
'):
if not isinstance(v, int):
if parameters[parameter] in bytes_parameters:
v = _parse_bytes(v)
else:
...
...
zodburi/tests/test_resolvers.py
View file @
d1580fde
...
...
@@ -490,6 +490,31 @@ class TestZConfigURIResolver(unittest.TestCase):
expect
[
cparameter
]
*=
1
<<
20
self
.
assertEqual
(
dbkw
,
expect
)
def
test_database_integration_because_ints
(
self
):
from
zodburi
import
resolve_uri
self
.
tmp
.
write
(
b"""
<zodb>
<mappingstorage>
</mappingstorage>
</zodb>
"""
)
self
.
tmp
.
flush
()
from
zodburi
import
resolve_uri
factory
,
dbkw
=
resolve_uri
(
'zconfig://%s'
%
self
.
tmp
.
name
)
storage
=
factory
()
from
ZODB.MappingStorage
import
MappingStorage
self
.
assertTrue
(
isinstance
(
storage
,
MappingStorage
))
self
.
assertEqual
(
dbkw
,
{
'cache_size'
:
5000
,
'cache_size_bytes'
:
0
,
'historical_cache_size'
:
1000
,
'historical_cache_size_bytes'
:
0
,
'historical_pool_size'
:
3
,
'historical_timeout'
:
300
,
'large_record_size'
:
16777216
,
'pool_size'
:
7
,
'database_name'
:
'unnamed'
})
class
TestMappingStorageURIResolver
(
Base
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
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