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
ba261a69
Commit
ba261a69
authored
Apr 18, 2017
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed: changes in 2.2 broke the zconfig resolver.
parent
18a3a7ce
Changes
3
Hide 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 @
ba261a69
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
2.2.1 (unreleased)
2.2.1 (unreleased)
------------------
------------------
-
Nothing changed yet
.
-
Fixed: changes in 2.2 broke the zconfig resolver
.
2.2 (2017-04-17)
2.2 (2017-04-17)
...
...
zodburi/__init__.py
View file @
ba261a69
...
@@ -50,10 +50,11 @@ def _get_dbkw(kw):
...
@@ -50,10 +50,11 @@ def _get_dbkw(kw):
if parameter in kw:
if parameter in kw:
v = kw.pop(parameter)
v = kw.pop(parameter)
if parameter.startswith('
connection_
'):
if parameter.startswith('
connection_
'):
if parameters[parameter] in bytes_parameters:
if not isinstance(v, int):
v = _parse_bytes(v)
if parameters[parameter] in bytes_parameters:
else:
v = _parse_bytes(v)
v = int(v)
else:
v = int(v)
dbkw[parameters[parameter]] = v
dbkw[parameters[parameter]] = v
if kw:
if kw:
...
...
zodburi/tests/test_resolvers.py
View file @
ba261a69
...
@@ -490,6 +490,31 @@ class TestZConfigURIResolver(unittest.TestCase):
...
@@ -490,6 +490,31 @@ class TestZConfigURIResolver(unittest.TestCase):
expect
[
cparameter
]
*=
1
<<
20
expect
[
cparameter
]
*=
1
<<
20
self
.
assertEqual
(
dbkw
,
expect
)
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
):
class
TestMappingStorageURIResolver
(
Base
,
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
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