Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
cf8ec8c1
Commit
cf8ec8c1
authored
Jan 10, 2012
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow detecting pending connections at node level.
parent
59abb90d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
neo/lib/node.py
neo/lib/node.py
+3
-2
neo/tests/__init__.py
neo/tests/__init__.py
+3
-1
No files found.
neo/lib/node.py
View file @
cf8ec8c1
...
...
@@ -115,11 +115,12 @@ class Node(object):
assert
self
.
_connection
is
not
None
return
self
.
_connection
def
isConnected
(
self
):
def
isConnected
(
self
,
connecting
=
False
):
"""
Returns True is a connection is established with the node
"""
return
self
.
_connection
is
not
None
return
self
.
_connection
is
not
None
and
(
connecting
or
not
self
.
_connection
.
connecting
)
def
isIdentified
(
self
):
"""
...
...
neo/tests/__init__.py
View file @
cf8ec8c1
...
...
@@ -263,7 +263,7 @@ class NeoUnitTestBase(NeoTestBase):
is_server
=
False
,
connector
=
None
,
peer_id
=
None
):
if
connector
is
None
:
connector
=
self
.
getFakeConnector
()
return
Mock
({
conn
=
Mock
({
'getUUID'
:
uuid
,
'getAddress'
:
address
,
'isServer'
:
is_server
,
...
...
@@ -272,6 +272,8 @@ class NeoUnitTestBase(NeoTestBase):
'getConnector'
:
connector
,
'getPeerId'
:
peer_id
,
})
conn
.
connecting
=
False
return
conn
def
checkProtocolErrorRaised
(
self
,
method
,
*
args
,
**
kwargs
):
""" Check if the ProtocolError exception was raised """
...
...
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