Skip to content

Commit 1ae845b

Browse files
committed
Merge pull request #49 from neo4j/1.0-tck-tests
1.0 tck tests -Added auth and ignoring StatementResult API feature
2 parents c40e4dc + e5f235e commit 1ae845b

File tree

4 files changed

+65
-3
lines changed

4 files changed

+65
-3
lines changed

runtests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ echo ""
7979

8080
TEST_RUNNER="coverage run -m ${UNITTEST} discover -vfs ${TEST}"
8181
EXAMPLES_RUNNER="coverage run -m ${UNITTEST} discover -vfs examples"
82-
BEHAVE_RUNNER="behave --tags=-db --tags=-in_dev test/tck"
82+
BEHAVE_RUNNER="behave --tags=-db --tags=-in_dev --tags=-streaming_and_cursor_navigation test/tck"
8383

8484
if [ ${RUNNING} -eq 1 ]
8585
then

test/tck/environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def before_scenario(context, scenario):
3535
session = tck_util.driver.session()
3636
session.run("MATCH (n) DETACH DELETE n")
3737
session.close()
38-
if "equality_test" in scenario.tags:
38+
if "equality" in scenario.tags:
3939
context.values = {}
4040

4141

test/tck/steps/cypher_compability_steps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from behave import *
2222

2323
from test.tck import tck_util
24-
from test.tck.tck_util import TestValue, send_string, send_parameters
24+
from test.tck.tck_util import TestValue
2525
from test.tck.resultparser import parse_values, parse_values_to_comparable
2626

2727
use_step_matcher("re")
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env python
2+
# -*- encoding: utf-8 -*-
3+
4+
# Copyright (c) 2002-2016 "Neo Technology,"
5+
# Network Engine for Objects in Lund AB [http://neotechnology.com]
6+
#
7+
# This file is part of Neo4j.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
21+
from behave import *
22+
23+
from neo4j.v1 import GraphDatabase, basic_auth, exceptions
24+
25+
26+
@given("a driver configured with auth disabled")
27+
def step_impl(context):
28+
context.driver = GraphDatabase.driver("bolt://localhost", encrypted=False)
29+
30+
31+
@given("a driver is configured with auth enabled and correct password is provided")
32+
def step_impl(context):
33+
context.driver = GraphDatabase.driver("bolt://localhost", auth=basic_auth("neo4j", "password"), encrypted=False)
34+
35+
36+
@given("a driver is configured with auth enabled and the wrong password is provided")
37+
def step_impl(context):
38+
context.driver = GraphDatabase.driver("bolt://localhost", auth=basic_auth("neo4j", "wrong"), encrypted=False)
39+
40+
41+
@step("reading and writing to the database should be possible")
42+
def step_impl(context):
43+
session = context.driver.session()
44+
session.run("CREATE (:label1)")
45+
assert len(list(session.run("MATCH (n:label1) RETURN n"))) == 1
46+
session.close()
47+
48+
49+
@step("reading and writing to the database should not be possible")
50+
def step_impl(context):
51+
try:
52+
session = context.driver.session()
53+
session.run("CREATE (:label1)")
54+
session.close()
55+
assert False
56+
except exceptions.ProtocolError as e:
57+
pass
58+
59+
60+
@step("a `Protocol Error` is raised")
61+
def step_impl(context):
62+
pass

0 commit comments

Comments
 (0)