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
7502fa4f
Commit
7502fa4f
authored
Jan 18, 2019
by
Éloi Rivard
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tox tests with zodb4
parent
475f420d
Changes
4
Hide 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 @
7502fa4f
...
...
@@ -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 @
7502fa4f
...
...
@@ -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 @
7502fa4f
[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 @
7502fa4f
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,15 +442,26 @@ class TestZConfigURIResolver(unittest.TestCase):
storage
=
factory
()
from
ZODB.MappingStorage
import
MappingStorage
self
.
assertTrue
(
isinstance
(
storage
,
MappingStorage
))
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_large_record_size'
:
16777216
,
'connection_pool_size'
:
7
})
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
,
'connection_historical_cache_size'
:
1000
,
'connection_historical_cache_size_bytes'
:
0
,
'connection_historical_pool_size'
:
3
,
'connection_historical_timeout'
:
300
,
'connection_large_record_size'
:
16777216
,
'connection_pool_size'
:
7
})
def
test_named_database
(
self
):
self
.
tmp
.
write
(
b"""
...
...
@@ -463,16 +479,28 @@ class TestZConfigURIResolver(unittest.TestCase):
storage
=
factory
()
from
ZODB.MappingStorage
import
MappingStorage
self
.
assertTrue
(
isinstance
(
storage
,
MappingStorage
))
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_large_record_size'
:
16777216
,
'connection_pool_size'
:
5
,
'database_name'
:
'foo'
})
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
,
'connection_historical_cache_size'
:
1000
,
'connection_historical_cache_size_bytes'
:
0
,
'connection_historical_pool_size'
:
3
,
'connection_historical_timeout'
:
300
,
'connection_large_record_size'
:
16777216
,
'connection_pool_size'
:
5
,
'database_name'
:
'foo'
})
def
test_database_all_options
(
self
):
from
zodburi
import
connection_parameters
,
bytes_parameters
...
...
@@ -518,16 +546,28 @@ class TestZConfigURIResolver(unittest.TestCase):
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'
})
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
,
'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
):
...
...
Kirill Smelkov
@kirr
mentioned in commit
c4f00cc2
·
May 11, 2021
mentioned in commit
c4f00cc2
mentioned in commit c4f00cc2397fbee9afa0cd2c96b575ca793087c8
Toggle commit list
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