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
cc0e965f
Commit
cc0e965f
authored
Jun 09, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update test__backdoor.py
parent
f2542f93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
greentest/test__backdoor.py
greentest/test__backdoor.py
+20
-7
No files found.
greentest/test__backdoor.py
View file @
cc0e965f
...
...
@@ -17,14 +17,27 @@ def read_until(conn, postfix):
class
Test
(
greentest
.
TestCase
):
def
test
(
self
):
server
=
backdoor
.
BackdoorServer
.
spawn
((
'127.0.0.1'
,
7891
))
gevent
.
sleep
(
0
)
conn
=
socket
.
create_connection
((
'127.0.0.1'
,
7891
))
server
=
backdoor
.
BackdoorServer
((
'127.0.0.1'
,
0
))
server
.
start
()
def
connect
():
conn
=
socket
.
create_connection
((
'127.0.0.1'
,
server
.
server_port
))
read_until
(
conn
,
'>>> '
)
conn
.
sendall
(
'2+2
\
r
\
n
'
)
line
=
conn
.
makefile
().
readline
()
assert
line
.
strip
()
==
'4'
,
repr
(
line
)
jobs
=
[
gevent
.
spawn
(
connect
)
for
_
in
xrange
(
10
)]
gevent
.
joinall
(
jobs
)
server
.
kill
()
#self.assertEqual(conn.recv(1), '')
def
test_quit
(
self
):
server
=
backdoor
.
BackdoorServer
((
'127.0.0.1'
,
0
))
server
.
start
()
conn
=
socket
.
create_connection
((
'127.0.0.1'
,
server
.
server_port
))
read_until
(
conn
,
'>>> '
)
conn
.
sendall
(
'2+2
\
r
\
n
'
)
line
=
conn
.
makefile
().
readline
()
assert
line
.
strip
()
==
'4'
,
repr
(
line
)
server
.
kill
(
block
=
True
)
conn
.
sendall
(
'quit()
\
r
\
n
'
)
line
=
conn
.
makefile
().
read
()
self
.
assertEqual
(
line
,
''
)
if
__name__
==
'__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