Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
8707190c
Commit
8707190c
authored
Dec 01, 2013
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spurious failures in test__socket_dns6.py
parent
bd902f49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
20 deletions
+28
-20
greentest/test__socket_dns.py
greentest/test__socket_dns.py
+28
-20
No files found.
greentest/test__socket_dns.py
View file @
8707190c
...
@@ -75,24 +75,27 @@ def log_call(result, time, function, *args):
...
@@ -75,24 +75,27 @@ def log_call(result, time, function, *args):
log_fresult
(
result
,
time
)
log_fresult
(
result
,
time
)
google_host_re
=
re
.
compile
(
'^arn[a-z0-9-]+.1e100.net$'
)
def
compare_relaxed
(
a
,
b
):
def
compare_ipv6
(
a
,
b
):
"""
"""
>>> compare_
ipv6
('2a00:1450:400f:801::1010', '2a00:1450:400f:800::1011')
>>> compare_
relaxed
('2a00:1450:400f:801::1010', '2a00:1450:400f:800::1011')
True
True
>>> compare_ipv6('2a00:1450:400f:801::1010', '2aXX:1450:400f:900::1011')
>>> compare_relaxed('2a00:1450:400f:801::1010', '2aXX:1450:400f:900::1011')
False
False
>>> compare_ipv6('2a00:1450:4016:800::1013', '2a00:1450:4008:c01::93')
>>> compare_relaxed('2a00:1450:4016:800::1013', '2a00:1450:4008:c01::93')
True
True
>>> compare_relaxed('a.surfly.com', 'b.surfly.com')
True
>>> compare_relaxed('a.surfly.com', 'a.gevent.org')
False
"""
"""
if
a
.
count
(
':'
)
==
5
and
b
.
count
(
':'
)
==
5
:
if
a
.
count
(
':'
)
==
5
and
b
.
count
(
':'
)
==
5
:
# QQQ not actually sure if this is right thing to do
# QQQ not actually sure if this is right thing to do
return
a
.
rsplit
(
':'
)[:
2
]
==
b
.
rsplit
(
':'
)[:
2
]
return
a
.
rsplit
(
':'
)[:
2
]
==
b
.
rsplit
(
':'
)[:
2
]
if
google_host_re
.
match
(
a
)
and
google_host_re
.
match
(
b
):
return
a
.
split
(
'.'
,
1
)[
-
1
]
==
b
.
split
(
'.'
,
1
)[
-
1
]
return
True
return
a
==
b
def
contains_5tuples
(
lst
):
def
contains_5tuples
(
lst
):
...
@@ -106,24 +109,29 @@ def relaxed_is_equal(a, b):
...
@@ -106,24 +109,29 @@ def relaxed_is_equal(a, b):
"""
"""
>>> relaxed_is_equal([(10, 1, 6, '', ('2a00:1450:400f:801::1010', 80, 0, 0))], [(10, 1, 6, '', ('2a00:1450:400f:800::1011', 80, 0, 0))])
>>> relaxed_is_equal([(10, 1, 6, '', ('2a00:1450:400f:801::1010', 80, 0, 0))], [(10, 1, 6, '', ('2a00:1450:400f:800::1011', 80, 0, 0))])
True
True
>>> relaxed_is_equal([1, '2'], (1, '2'))
>>> relaxed_is_equal([1, '2'], (1, '2'))
False
False
>>> relaxed_is_equal([1, '2'], [1, '2'])
>>> relaxed_is_equal([1, '2'], [1, '2'])
True
True
>>> relaxed_is_equal(('wi-in-x93.1e100.net', 'http'), ('we-in-x68.1e100.net', 'http'))
True
"""
"""
if
type
(
a
)
is
not
type
(
b
):
if
type
(
a
)
is
not
type
(
b
):
return
False
return
False
if
a
==
b
:
return
True
if
isinstance
(
a
,
basestring
):
if
isinstance
(
a
,
basestring
):
return
compare_ipv6
(
a
,
b
)
return
compare_relaxed
(
a
,
b
)
if
hasattr
(
a
,
'__iter__'
):
if
len
(
a
)
!=
len
(
b
):
if
len
(
a
)
!=
len
(
b
):
return
False
return
False
if
contains_5tuples
(
a
)
and
contains_5tuples
(
b
):
if
contains_5tuples
(
a
)
and
contains_5tuples
(
b
):
# getaddrinfo results
# getaddrinfo results
a
=
sorted
(
a
)
a
=
sorted
(
a
)
b
=
sorted
(
b
)
b
=
sorted
(
b
)
return
all
(
relaxed_is_equal
(
x
,
y
)
for
(
x
,
y
)
in
zip
(
a
,
b
))
return
all
(
relaxed_is_equal
(
x
,
y
)
for
(
x
,
y
)
in
zip
(
a
,
b
))
return
a
==
b
def
add
(
klass
,
hostname
,
name
=
None
):
def
add
(
klass
,
hostname
,
name
=
None
):
...
...
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