Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
2261d4c4
Commit
2261d4c4
authored
Nov 12, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1521 from edx/ned/quiet-mock-youtube-test-server
Mock servers shouldn't pollute test output.
parents
336d648e
c8e0fb25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
common/lib/xmodule/xmodule/util/mock_youtube_server/mock_youtube_server.py
+15
-3
No files found.
common/lib/xmodule/xmodule/util/mock_youtube_server/mock_youtube_server.py
View file @
2261d4c4
from
BaseHTTPServer
import
HTTPServer
,
BaseHTTPRequestHandler
import
urlparse
import
json
import
mock
import
sys
import
threading
import
json
import
time
import
urlparse
from
logging
import
getLogger
logger
=
getLogger
(
__name__
)
import
time
class
MockYoutubeRequestHandler
(
BaseHTTPRequestHandler
):
'''
...
...
@@ -14,6 +17,15 @@ class MockYoutubeRequestHandler(BaseHTTPRequestHandler):
protocol
=
"HTTP/1.0"
def
log_message
(
self
,
format
,
*
args
):
"""Log an arbitrary message."""
# Code copied from BaseHTTPServer.py. Changed to write to sys.stdout
# so that messages won't pollute test output.
sys
.
stdout
.
write
(
"
%
s - - [
%
s]
%
s
\n
"
%
(
self
.
client_address
[
0
],
self
.
log_date_time_string
(),
format
%
args
))
def
do_HEAD
(
self
):
code
=
200
if
'test_transcripts_youtube'
in
self
.
path
:
...
...
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