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
Xavier Thompson
neoppod
Commits
3fbffa00
Commit
3fbffa00
authored
Nov 04, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test_parseNodeAddress when ipv6 is configured and preferred for 'localhost'
parent
c21f054e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
neo/tests/testUtil.py
neo/tests/testUtil.py
+5
-7
No files found.
neo/tests/testUtil.py
View file @
3fbffa00
...
@@ -44,13 +44,10 @@ class UtilTests(NeoUnitTestBase):
...
@@ -44,13 +44,10 @@ class UtilTests(NeoUnitTestBase):
address_type
=
getAddressType
((
'127.0.0.1'
,
0
))
address_type
=
getAddressType
((
'127.0.0.1'
,
0
))
self
.
assertEqual
(
address_type
,
socket
.
AF_INET
)
self
.
assertEqual
(
address_type
,
socket
.
AF_INET
)
def
_assertEqualParsedAddress
(
self
,
parsed
,
*
args
,
**
kw
):
self
.
assertEqual
(
parsed
,
parseNodeAddress
(
*
args
,
**
kw
))
def
test_parseNodeAddress
(
self
):
def
test_parseNodeAddress
(
self
):
""" Parsing of addesses """
""" Parsing of addesses """
test
=
self
.
_assertEqualParsedAddress
def
test
(
parsed
,
*
args
):
local_address
=
socket
.
gethostbyname
(
'localhost'
)
self
.
assertEqual
(
parsed
,
parseNodeAddress
(
*
args
)
)
http_port
=
socket
.
getservbyname
(
'http'
)
http_port
=
socket
.
getservbyname
(
'http'
)
test
((
'127.0.0.1'
,
0
),
'127.0.0.1'
)
test
((
'127.0.0.1'
,
0
),
'127.0.0.1'
)
test
((
'127.0.0.1'
,
10
),
'127.0.0.1:10'
,
500
)
test
((
'127.0.0.1'
,
10
),
'127.0.0.1:10'
,
500
)
...
@@ -60,8 +57,9 @@ class UtilTests(NeoUnitTestBase):
...
@@ -60,8 +57,9 @@ class UtilTests(NeoUnitTestBase):
test
((
'::1'
,
500
),
'[::1]'
,
500
)
test
((
'::1'
,
500
),
'[::1]'
,
500
)
test
((
'::1'
,
http_port
),
'[::1]:http'
)
test
((
'::1'
,
http_port
),
'[::1]:http'
)
test
((
'::1'
,
0
),
'[0::01]'
)
test
((
'::1'
,
0
),
'[0::01]'
)
test
((
local_address
,
0
),
'localhost'
)
local_address
=
lambda
port
:
((
'127.0.0.1'
,
port
),
(
'::1'
,
port
))
test
((
local_address
,
10
),
'localhost:10'
)
self
.
assertIn
(
parseNodeAddress
(
'localhost'
),
local_address
(
0
))
self
.
assertIn
(
parseNodeAddress
(
'localhost:10'
),
local_address
(
10
))
def
testReadBufferRead
(
self
):
def
testReadBufferRead
(
self
):
""" Append some chunk then consume the data """
""" Append some chunk then consume the data """
...
...
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