Skip to content

Commit acfac71

Browse files
author
Zhen
committed
cleanup some imports
This is to fix some error run tests on zhen's local machine
1 parent 8a00a78 commit acfac71

File tree

11 files changed

+19
-20
lines changed

11 files changed

+19
-20
lines changed

neo4j/bolt/connection.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@
3434
from struct import pack as struct_pack, unpack as struct_unpack
3535
from threading import RLock, Condition
3636

37-
from neo4j.v1 import ClientError
3837
from neo4j.addressing import SocketAddress, is_ip_address
3938
from neo4j.bolt.cert import KNOWN_HOSTS
4039
from neo4j.bolt.response import InitResponse, AckFailureResponse, ResetResponse
4140
from neo4j.compat.ssl import SSL_AVAILABLE, HAS_SNI, SSLError
42-
from neo4j.exceptions import ProtocolError, SecurityError, ServiceUnavailable
41+
from neo4j.exceptions import ClientError, ProtocolError, SecurityError, ServiceUnavailable
4342
from neo4j.meta import version
4443
from neo4j.packstream import Packer, Unpacker
4544
from neo4j.util import import_best as _import_best

neo4j/v1/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
# See the License for the specific language governing permissions and
1919
# limitations under the License.
2020

21-
22-
from neo4j.exceptions import *
23-
2421
from .api import *
2522
from .direct import *
2623
from .exceptions import *

neo4j/v1/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
from time import time, sleep
2626
from warnings import warn
2727

28-
from neo4j.bolt import ProtocolError, ServiceUnavailable
29-
from neo4j.compat import unicode, urlparse
28+
from neo4j.exceptions import ProtocolError, ServiceUnavailable
29+
from neo4j.compat import urlparse
3030
from neo4j.exceptions import CypherError, TransientError
3131

3232
from .exceptions import DriverError, SessionError, SessionExpired, TransactionError

neo4j/v1/direct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
from neo4j.addressing import SocketAddress, resolve
23-
from neo4j.bolt import DEFAULT_PORT, ConnectionPool, connect, ConnectionErrorHandler
23+
from neo4j.bolt.connection import DEFAULT_PORT, ConnectionPool, connect, ConnectionErrorHandler
2424
from neo4j.exceptions import ServiceUnavailable
2525
from neo4j.v1.api import Driver
2626
from neo4j.v1.security import SecurityPlan

test/integration/test_driver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
# limitations under the License.
2020

2121

22-
from neo4j.v1 import GraphDatabase, ProtocolError, ServiceUnavailable
23-
22+
from neo4j.v1 import GraphDatabase, ServiceUnavailable
23+
from neo4j.exceptions import ProtocolError
2424
from test.integration.tools import IntegrationTestCase
2525

2626

test/integration/test_security.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
from ssl import SSLSocket
2424
from unittest import skipUnless
2525

26-
from neo4j.v1 import GraphDatabase, SSL_AVAILABLE, TRUST_ON_FIRST_USE, TRUST_CUSTOM_CA_SIGNED_CERTIFICATES, AuthError
26+
from neo4j.v1 import GraphDatabase, SSL_AVAILABLE, TRUST_ON_FIRST_USE, TRUST_CUSTOM_CA_SIGNED_CERTIFICATES
27+
from neo4j.exceptions import AuthError
2728

2829
from test.integration.tools import IntegrationTestCase
2930

test/integration/test_session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
from neo4j.v1 import \
2525
READ_ACCESS, WRITE_ACCESS, \
2626
CypherError, SessionError, TransactionError, \
27-
Node, Relationship, Path, CypherSyntaxError
27+
Node, Relationship, Path
28+
from neo4j.exceptions import CypherSyntaxError
2829

2930
from test.integration.tools import DirectIntegrationTestCase
3031

test/integration/tools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232

3333
from boltkit.controller import WindowsController, UnixController
3434

35-
from neo4j.v1 import GraphDatabase, AuthError
35+
from neo4j.v1 import GraphDatabase
36+
from neo4j.exceptions import AuthError
3637
from neo4j.util import ServerVersion
3738

3839
from test.env import NEO4J_SERVER_PACKAGE, NEO4J_USER, NEO4J_PASSWORD

test/performance/tools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434

3535
from boltkit.controller import WindowsController, UnixController
3636

37-
from neo4j.v1 import GraphDatabase, AuthError
37+
from neo4j.v1 import GraphDatabase
38+
from neo4j.exceptions import AuthError
3839
from neo4j.util import ServerVersion
3940

4041
from test.env import NEO4J_SERVER_PACKAGE, NEO4J_USER, NEO4J_PASSWORD

test/stub/test_routingdriver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
from neo4j.v1 import GraphDatabase, READ_ACCESS, WRITE_ACCESS, SessionExpired, \
2323
RoutingDriver, RoutingConnectionPool, LeastConnectedLoadBalancingStrategy, LOAD_BALANCING_STRATEGY_ROUND_ROBIN, \
24-
RoundRobinLoadBalancingStrategy, TransientError, ClientError
24+
RoundRobinLoadBalancingStrategy, TransientError
25+
from neo4j.exceptions import ClientError
2526
from neo4j.bolt import ProtocolError, ServiceUnavailable
2627

2728
from test.stub.tools import StubTestCase, StubCluster

test/unit/test_connection.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
# See the License for the specific language governing permissions and
1919
# limitations under the License.
2020
from __future__ import print_function
21-
import time
2221
from unittest import TestCase
2322
from threading import Thread, Event
24-
from neo4j.v1 import DirectConnectionErrorHandler, ClientError, ServiceUnavailable
23+
from neo4j.v1 import DirectConnectionErrorHandler, ServiceUnavailable
2524
from neo4j.bolt import Connection, ConnectionPool
26-
25+
from neo4j.exceptions import ClientError
2726

2827
class FakeSocket(object):
2928
def __init__(self, address):
@@ -164,9 +163,8 @@ def test_max_conn_pool_size(self):
164163
address = ("127.0.0.1", 7687)
165164
pool.acquire_direct(address)
166165
self.assertEqual(pool.in_use_connection_count(address), 1)
167-
with self.assertRaises(ClientError) as context:
166+
with self.assertRaises(ClientError):
168167
pool.acquire_direct(address)
169-
self.assertTrue('Failed to obtain a connection from pool within 0s' in context.exception)
170168
self.assertEqual(pool.in_use_connection_count(address), 1)
171169

172170
def test_multithread(self):

0 commit comments

Comments
 (0)