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
691d752f
Commit
691d752f
authored
Aug 18, 2009
by
Jason Toffaletti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some basic dns tests
--HG-- extra : transplant_source : %876%5Dg%BE%D6%1E5%3C2%BF%2A%D8a%0B%D5%FAU%0A-
parent
2cff4359
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
greentest/test__socket_dns.py
greentest/test__socket_dns.py
+35
-0
No files found.
greentest/test__socket_dns.py
0 → 100644
View file @
691d752f
#!/usr/bin/python
from
gevent
import
monkey
;
monkey
.
patch_all
()
from
gevent
import
socket
import
unittest
class
GetAddrInfoTest
(
unittest
.
TestCase
):
def
test_localhost
(
self
):
socket
.
getaddrinfo
(
'localhost'
,
0
)
socket
.
getaddrinfo
(
'127.0.0.1'
,
0
)
def
test_google
(
self
):
socket
.
getaddrinfo
(
'www.google.com'
,
80
)
class
GetNameInfoTest
(
unittest
.
TestCase
):
def
test_localhost
(
self
):
socket
.
getnameinfo
((
'127.0.0.1'
,
0
),
0
)
def
test_google
(
self
):
socket
.
getnameinfo
((
'74.125.19.105'
,
80
),
0
)
class
GetHostByNameTest
(
unittest
.
TestCase
):
def
test_localhost
(
self
):
socket
.
gethostbyname
(
'localhost'
)
socket
.
gethostbyname
(
'127.0.0.1'
)
def
test_google
(
self
):
socket
.
gethostbyname
(
'www.google.com'
)
if
__name__
==
"__main__"
:
unittest
.
main
()
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