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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Iliya Manolov
neoppod
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
Hide 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