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
4175652e
Commit
4175652e
authored
Jan 18, 2019
by
Tres Seaver
Committed by
GitHub
Jan 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24 from azmeuk/tox-zodb4
Add tests for zodb4.
parents
475f420d
7502fa4f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
36 deletions
+89
-36
.travis.yml
.travis.yml
+14
-6
CONTRIBUTORS.txt
CONTRIBUTORS.txt
+1
-0
tox.ini
tox.ini
+5
-1
zodburi/tests/test_resolvers.py
zodburi/tests/test_resolvers.py
+69
-29
No files found.
.travis.yml
View file @
4175652e
...
...
@@ -5,19 +5,27 @@ sudo: false
matrix
:
include
:
-
python
:
2.7
env
:
TOXENV=py27
env
:
TOXENV=py27-zodb4
-
python
:
2.7
env
:
TOXENV=py27-zodb5
-
python
:
3.4
env
:
TOXENV=py34-zodb4
-
python
:
3.4
env
:
TOXENV=py34
env
:
TOXENV=py34
-zodb5
-
python
:
3.5
env
:
TOXENV=py35
env
:
TOXENV=py35-zodb4
-
python
:
3.5
env
:
TOXENV=py35-zodb5
-
python
:
3.6
env
:
TOXENV=py36-zodb4
-
python
:
3.6
env
:
TOXENV=py36
env
:
TOXENV=py36
-zodb5
-
python
:
3.7
env
:
TOXENV=py37
env
:
TOXENV=py37
-zodb5
dist
:
xenial
sudo
:
true
-
python
:
3.8-dev
env
:
TOXENV=py38
env
:
TOXENV=py38
-zodb5
dist
:
xenial
sudo
:
true
allow_failures
:
...
...
CONTRIBUTORS.txt
View file @
4175652e
...
...
@@ -103,3 +103,4 @@ Contributors
- Todd Koym, 2016/07/21
- Jim Fulton, 2017/04/13
- Kirill Smelkov, 2017/10/17
- Éloi Rivard, 2019/01/18
tox.ini
View file @
4175652e
[tox]
envlist
=
py27,py34,py35,py36,py37
,cover,docs
{py27,py34,py35,py36}-{zodb4,zodb5},py37-zodb5
,cover,docs
[testenv]
commands
=
python
setup.py
-q
test
-q
deps
=
mock
zodb4:
ZODB
=
=4.*
zodb5:
ZODB
=
=5.*
zodb4:
ZEO
=
=4.*
zodb5:
ZEO
=
=5.*
[testenv:cover]
basepython
=
...
...
zodburi/tests/test_resolvers.py
View file @
4175652e
import
mock
import
pkg_resources
import
unittest
ZODB_VERSION
=
tuple
(
map
(
int
,
pkg_resources
.
get_distribution
(
"ZODB"
).
version
.
split
(
'.'
)))
class
Base
:
def
test_interpret_kwargs_noargs
(
self
):
...
...
@@ -437,6 +442,16 @@ class TestZConfigURIResolver(unittest.TestCase):
storage
=
factory
()
from
ZODB.MappingStorage
import
MappingStorage
self
.
assertTrue
(
isinstance
(
storage
,
MappingStorage
))
if
ZODB_VERSION
[
0
]
<
5
:
self
.
assertEqual
(
dbkw
,
{
'connection_cache_size'
:
5000
,
'connection_cache_size_bytes'
:
0
,
'connection_historical_cache_size'
:
1000
,
'connection_historical_cache_size_bytes'
:
0
,
'connection_historical_pool_size'
:
3
,
'connection_historical_timeout'
:
300
,
'connection_pool_size'
:
7
})
else
:
self
.
assertEqual
(
dbkw
,
{
'connection_cache_size'
:
5000
,
'connection_cache_size_bytes'
:
0
,
...
...
@@ -447,6 +462,7 @@ class TestZConfigURIResolver(unittest.TestCase):
'connection_large_record_size'
:
16777216
,
'connection_pool_size'
:
7
})
def
test_named_database
(
self
):
self
.
tmp
.
write
(
b"""
<zodb x>
...
...
@@ -463,6 +479,17 @@ class TestZConfigURIResolver(unittest.TestCase):
storage
=
factory
()
from
ZODB.MappingStorage
import
MappingStorage
self
.
assertTrue
(
isinstance
(
storage
,
MappingStorage
))
if
ZODB_VERSION
[
0
]
<
5
:
self
.
assertEqual
(
dbkw
,
{
'connection_cache_size'
:
20000
,
'connection_cache_size_bytes'
:
0
,
'connection_historical_cache_size'
:
1000
,
'connection_historical_cache_size_bytes'
:
0
,
'connection_historical_pool_size'
:
3
,
'connection_historical_timeout'
:
300
,
'connection_pool_size'
:
5
,
'database_name'
:
'foo'
})
else
:
self
.
assertEqual
(
dbkw
,
{
'connection_cache_size'
:
20000
,
'connection_cache_size_bytes'
:
0
,
...
...
@@ -474,6 +501,7 @@ class TestZConfigURIResolver(unittest.TestCase):
'connection_pool_size'
:
5
,
'database_name'
:
'foo'
})
def
test_database_all_options
(
self
):
from
zodburi
import
connection_parameters
,
bytes_parameters
self
.
tmp
.
write
((
"""
...
...
@@ -518,6 +546,17 @@ class TestZConfigURIResolver(unittest.TestCase):
storage
=
factory
()
from
ZODB.MappingStorage
import
MappingStorage
self
.
assertTrue
(
isinstance
(
storage
,
MappingStorage
))
if
ZODB_VERSION
[
0
]
<
5
:
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
,
'pool_size'
:
7
,
'database_name'
:
'unnamed'
})
else
:
self
.
assertEqual
(
dbkw
,
{
'cache_size'
:
5000
,
'cache_size_bytes'
:
0
,
...
...
@@ -529,6 +568,7 @@ class TestZConfigURIResolver(unittest.TestCase):
'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