Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
059cb03c
Commit
059cb03c
authored
Nov 04, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respect NEO_TESTS_ADAPTER for all tests run by -u
parent
3fbffa00
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
neo/tests/__init__.py
neo/tests/__init__.py
+15
-3
No files found.
neo/tests/__init__.py
View file @
059cb03c
...
...
@@ -178,9 +178,21 @@ class NeoUnitTestBase(NeoTestBase):
self
.
uuid_dict
=
{}
NeoTestBase
.
setUp
(
self
)
def
prepareDatabase
(
self
,
number
,
prefix
=
'test_neo'
):
""" create empties databases """
setupMySQLdb
([
'%s%u'
%
(
prefix
,
i
)
for
i
in
xrange
(
number
)])
def
prepareDatabase
(
self
,
number
,
prefix
=
DB_PREFIX
):
""" create empty databases """
adapter
=
os
.
getenv
(
'NEO_TESTS_ADAPTER'
,
'MySQL'
)
if
adapter
==
'MySQL'
:
setupMySQLdb
([
prefix
+
str
(
i
)
for
i
in
xrange
(
number
)])
elif
adapter
==
'SQLite'
:
temp_dir
=
getTempDirectory
()
for
i
in
xrange
(
number
):
try
:
os
.
remove
(
os
.
path
.
join
(
temp_dir
,
'test_neo%s.sqlite'
%
i
))
except
OSError
,
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
else
:
assert
False
,
adapter
def
getMasterConfiguration
(
self
,
cluster
=
'main'
,
master_number
=
2
,
replicas
=
2
,
partitions
=
1009
,
uuid
=
None
):
...
...
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