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
c44cf31a
Commit
c44cf31a
authored
Apr 22, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename wsgi_test.py to test__pywsgi.py
--HG-- rename : greentest/wsgi_test.py => greentest/test__pywsgi.py
parent
8da12eb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
+18
-15
greentest/test__pywsgi.py
greentest/test__pywsgi.py
+10
-11
greentest/test__wsgi.py
greentest/test__wsgi.py
+8
-4
No files found.
greentest/
wsgi_test
.py
→
greentest/
test__pywsgi
.py
View file @
c44cf31a
...
...
@@ -200,18 +200,17 @@ class TestCase(greentest.TestCase):
validator
=
staticmethod
(
validator
)
def
get_listener
(
self
):
return
(
'127.0.0.1'
,
0
)
def
init_server
(
self
,
application
):
self
.
server
=
self
.
get_wsgi_module
().
WSGIServer
((
'127.0.0.1'
,
0
),
application
)
def
setUp
(
self
):
greentest
.
TestCase
.
setUp
(
self
)
application
=
self
.
application
if
self
.
validator
is
not
None
:
application
=
self
.
validator
(
application
)
listener
=
self
.
get_listener
()
self
.
server
=
self
.
get_wsgi_module
().
WSGIServer
(
listener
,
application
)
self
.
init_server
(
application
)
self
.
server
.
start
()
self
.
port
=
self
.
server
.
server_port
greentest
.
TestCase
.
setUp
(
self
)
def
tearDown
(
self
):
greentest
.
TestCase
.
tearDown
(
self
)
...
...
@@ -484,12 +483,11 @@ class TestUseWrite(TestCase):
class
HttpsTestCase
(
TestCase
):
def
get_listener
(
self
):
certificate_file
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'test_server.crt'
)
private_key_file
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'test_server.key'
)
sock
=
socket
.
socket
()
socket
.
bind_and_listen
(
sock
,
(
''
,
0
))
return
socket
.
ssl
(
sock
,
private_key_file
,
certificate_file
)
certfile
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'test_server.crt'
)
keyfile
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'test_server.key'
)
def
init_server
(
self
,
application
):
self
.
server
=
self
.
get_wsgi_module
().
WSGIServer
((
'127.0.0.1'
,
0
),
application
,
certfile
=
self
.
certfile
,
keyfile
=
self
.
keyfile
)
def
urlopen
(
self
,
*
args
,
**
kwargs
):
req
=
HTTPRequest
(
"https://localhost:%s/foo"
%
self
.
server
.
server_port
,
*
args
,
**
kwargs
)
...
...
@@ -606,6 +604,7 @@ class TestError_after_start_response(TestError):
start_response
(
'200 OK'
,
[(
'Content-Type'
,
'text/plain'
)])
raise
ExpectedException
class
TestEmptyYield
(
TestCase
):
@
staticmethod
...
...
greentest/test__wsgi.py
View file @
c44cf31a
from
gevent
import
wsgi
import
wsgi_test
from
wsgi_test
import
*
import
test__pywsgi
from
test__pywsgi
import
*
del
TestHttps
wsgi_test
.
server_implements_chunked
=
False
test__pywsgi
.
server_implements_chunked
=
False
TestCase
.
get_wsgi_module
=
lambda
*
args
:
wsgi
class
TestHttpsError
(
HttpsTestCase
):
def
setUp
(
self
):
listener
=
self
.
get_listener
()
from
gevent.socket
import
ssl
,
socket
listener
=
socket
()
listener
.
bind
((
'0.0.0.0'
,
0
))
listener
.
listen
(
5
)
listener
=
ssl
(
listener
,
keyfile
=
self
.
keyfile
,
certfile
=
self
.
certfile
)
self
.
assertRaises
(
TypeError
,
self
.
get_wsgi_module
().
WSGIServer
,
listener
,
self
.
application
)
def
tearDown
(
self
):
...
...
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