This package provides a neo4j server stub setup based on a real neo4j server.
README
setup
This test is using a neo4j server. The test setUp method used for this test is calling our startNeo4jServer method which is starting a neo4j server. The first time this test get called a new neo4j server will get downloaded. The test setup looks like:
def test_suite():
return unittest.TestSuite((
doctest.DocFileSuite('README.txt',
setUp=testing.doctestSetUp, tearDown=testing.doctestTearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
encoding='utf-8'),
))
Your setup with a custom conf folder could look like:
def mySetUp(test):
# setup neo4j server
here = os.path.dirname(__file__)
sandbox = os.path.join(here, 'sandbox')
confSource = os.path.join(here, 'conf')
startNeo4jServer(sandbox, confSource=confSource)
def myTearDown(test):
# tear down neo4j server
here = os.path.dirname(__file__)
sandbox = os.path.join(here, 'sandbox')
stopNeo4jServer(sandbox)
# do some custom teardown stuff here
Also see our test.py for a sample setup.
windows
On windows a service with the name p01_neo4jstub_testing get installed and removed during the test run. This is not nice but that’s how neo4j can get stopped after starting. If soemthing fails and the service dosn’t get removed, you can simply use the follwoingcommand for remove the service:
sc delete p01_neo4jstub_testing
testing
Let’s setup a python httplib connection:
>>> import httplib
>>> conn = httplib.HTTPConnection('localhost', 47474)
and test the cluster state:
>>> conn.request('GET', '/db/data')
>>> response = conn.getresponse()
>>> response.status
302
CHANGES
0.5.0 (28-06-2013)
initial release
Release files for p01.neo4jstub 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| p01.neo4jstub-0.5.0.zip | 22.2 kB | Details |
Release files / p01.neo4jstub-0.5.0.zip
| Download URL | p01.neo4jstub-0.5.0.zip |
|---|---|
| Size | 22.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fb05fff34f872ca5ca259b582eb5061a467b12c63250f347792023aa2bd01ac
|
|
BLAKE2b-256 checksum How to use checksums |
dc33465e5f33f55597a7223128474c8a42ae08cd4af606817ea16156be1991f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |