Issue 552 in gdata-python-client: atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails

374 views
Skip to first unread message

gdata-pyt...@googlecode.com

unread,
Oct 19, 2011, 6:28:05 AM10/19/11
to gdata-python-client-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 552 by Arfrever...@gmail.com:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse()
fails. I use gdata-2.0.15, but this problem occurs also with at least
gdata-2.0.14. This problem occurs with both Python 2.6 and 2.7.

Output of tests contains:

Running all tests in module atom_tests.mock_http_test
F..
======================================================================
FAIL: testRecordResponse (atom_tests.mock_http_test.MockHttpClientUnitTest)
----------------------------------------------------------------------
Traceback (most recent call last):

File "/var/tmp/portage/dev-python/gdata-2.0.15/work/gdata-2.0.15/tests/atom_tests/mock_http_test.py",
line 49, in testRecordResponse
self.assertEquals(live_response.status, 200)
AssertionError: 502 != 200

----------------------------------------------------------------------
Ran 3 tests in 40.224s

FAILED (failures=1)

gdata-pyt...@googlecode.com

unread,
Nov 19, 2011, 11:14:06 PM11/19/11
to gdata-python-client-...@googlegroups.com

Comment #1 on issue 552 by yiti...@google.com:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

After a few different approaches based on the tutorial, I am still getting
the same error as well as this one:

FAIL: testFindTokenForScope (gdata_tests.client_test.GDataClientTest)


----------------------------------------------------------------------
Traceback (most recent call last):

File "/home/yitingc/gdata.py-1.2.4/tests/gdata_tests/client_test.py", line
82, in testFindTokenForScope
self.client.token_store.find_token('foo%s' % scope1) != auth_token)
AssertionError


gdata-pyt...@googlecode.com

unread,
Jan 2, 2012, 9:47:37 PM1/2/12
to gdata-python-client-...@googlegroups.com

Comment #2 on issue 552 by mcup...@uci.edu:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

I'm getting the same problem. Here's the output:

Running all tests in module atom_tests.mock_http_test
F..
======================================================================
FAIL: testRecordResponse (atom_tests.mock_http_test.MockHttpClientUnitTest)

----------------------------------------------------------------------
Traceback (most recent call last):

File "/Users/michaelcupino/Desktop/gdata-2.0.15/tests/atom_tests/mock_http_test.py",
line 49, in t


estRecordResponse
self.assertEquals(live_response.status, 200)
AssertionError: 502 != 200

----------------------------------------------------------------------
Ran 3 tests in 40.105s

FAILED (failures=1)


Here's the output after I attempted to reinstall:

$ python ./setup.py install
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267:
UserWarning:
Unknown distribution option: 'install_requires'
warnings.warn(msg)
running install
running build
running build_py
running install_lib
running install_egg_info
Removing
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gdata-2.0.15-py2.7.egg-info
Writing
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gdata-2.0.15-py2.7.egg-info

I looked up solutions for the warning, and it was suggested to install
setuptools. Removing and installing setuptools didn't help either with that
warning.


gdata-pyt...@googlecode.com

unread,
Mar 2, 2012, 9:39:10 AM3/2/12
to gdata-python-client-...@googlegroups.com

Comment #3 on issue 552 by Mitya57:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

Confirmed on Debian unstable with gdata 2.0.16.

gdata-pyt...@googlecode.com

unread,
Mar 7, 2012, 5:54:35 PM3/7/12
to gdata-python-client-...@googlegroups.com

Comment #4 on issue 552 by jfran...@schoolofrock.com:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

Same issue ...

"""
Running all tests in module atom_tests.mock_http_test
F..
======================================================================
FAIL: testRecordResponse (atom_tests.mock_http_test.MockHttpClientUnitTest)
----------------------------------------------------------------------
Traceback (most recent call last):

File "/Users/jonathan/Downloads/gdata-2.0.16/tests/atom_tests/mock_http_test.py",

line 49, in testRecordResponse
self.assertEquals(live_response.status, 200)
AssertionError: 502 != 200

----------------------------------------------------------------------
Ran 3 tests in 40.595s
"""

Mac OS X 10.7.3
Python 2.7.1
gdata-2.0.16

gdata-pyt...@googlecode.com

unread,
Apr 22, 2012, 7:44:13 AM4/22/12
to gdata-python-client-...@googlegroups.com

Comment #5 on issue 552 by Mitya57:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

I believe this is an error on Google servers, not a python-gdata bug.

$ wget http://www.google.com/base/feeds/snippets?max-results=1
--2012-04-22 15:40:45--
http://www.google.com/base/feeds/snippets?max-results=1
Resolving www.google.com (www.google.com)... 74.125.232.17, 74.125.232.20,
74.125.232.16, ...
Connecting to www.google.com (www.google.com)|74.125.232.17|:80...
connected.
HTTP request sent, awaiting response... 502 Bad Gateway
2012-04-22 15:41:25 ERROR 502: Bad Gateway.

gdata-pyt...@googlecode.com

unread,
Jul 5, 2012, 9:21:53 AM7/5/12
to gdata-python-client-...@googlegroups.com

Comment #6 on issue 552 by aging.mi...@gmail.com:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

Inserting the line print live_response.read() between lines 48 and 49 (in
testResponseRead() ) prints out the HTML corresponding to that HTTP error,
so I'm with Mitya here.

If it matters at all to the developer, I'm running Python 2.7.3 on Ubuntu
Server x64 12.04.

gdata-pyt...@googlecode.com

unread,
Jul 17, 2012, 4:34:51 PM7/17/12
to gdata-python-client-...@googlegroups.com

Comment #7 on issue 552 by yed...@gmail.com:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

Same problem with Python 2.7.1 on OS X 10.7.4.

Message has been deleted

gdata-pyt...@googlecode.com

unread,
Nov 10, 2013, 10:32:30 PM11/10/13
to gdata-python-client-...@googlegroups.com

Comment #8 on issue 552 by orsha...@gmail.com:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

Almost the same problem, but 404 instead of 502:

FAIL: testRecordResponse (__main__.MockHttpClientUnitTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/atom_tests/mock_http_test.py", line 49, in testRecordResponse
self.assertEquals(live_response.status, 200)
AssertionError: 404 != 200

Python 2.7.5 on OS X 10.6.8.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

gdata-pyt...@googlecode.com

unread,
Nov 11, 2013, 11:32:57 PM11/11/13
to gdata-python-client-...@googlegroups.com

Comment #9 on issue 552 by andrewjo...@gmail.com:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

Same issue here with 404 != 200 error. On Ubuntu 12.04.

gdata-pyt...@googlecode.com

unread,
Dec 19, 2013, 10:43:44 AM12/19/13
to gdata-python-client-...@googlegroups.com

Comment #10 on issue 552 by unixtool...@gmail.com:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
http://code.google.com/p/gdata-python-client/issues/detail?id=552

Same issue here: Windows 7 Enterprise 64bit, 64bit python 2.7.6,
gdata-2.0.18.

Output from running all tests:
Running all tests in module atom_tests.mock_http_test
F..
======================================================================
FAIL: testRecordResponse (atom_tests.mock_http_test.MockHttpClientUnitTest)
----------------------------------------------------------------------
Traceback (most recent call last):

File "C:\Users\tonybo\Downloads\gdata-2.0.18\gdata-2.0.18\tests\atom_tests\mock_http_test.py",
line 49, in testRecordResponse
self.assertEquals(live_response.status, 200)
AssertionError: 404 != 200

gdata-pyt...@googlecode.com

unread,
Jan 30, 2015, 6:12:47 AM1/30/15
to gdata-python-client-...@googlegroups.com

Comment #11 on issue 552 by searc...@omnicommediagroup.com:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
https://code.google.com/p/gdata-python-client/issues/detail?id=552

Same issue here. I looked into the code, and it turns out it tries to get a
HTTP 200 response, but since
http://www.google.com/base/feeds/snippets?max-results=1 is a deprecated
URL, it gets a 404 response.

Solution: fix the code.

1. In lines 47 and 55, replace the Google URL with http://www.example.org
2: In line 50, deplace '<?xml' with '<!doctype'

gdata-pyt...@googlecode.com

unread,
Jan 30, 2015, 6:13:46 AM1/30/15
to gdata-python-client-...@googlegroups.com

Comment #12 on issue 552 by mikal.ma...@gmail.com:

gdata-pyt...@googlecode.com

unread,
Feb 26, 2015, 2:15:57 PM2/26/15
to gdata-python-client-...@googlegroups.com

Comment #13 on issue 552 by omnichro...@gmail.com:
atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails
https://code.google.com/p/gdata-python-client/issues/detail?id=552

Following Mikal's advice solved the problem for me - thanks very much.
Reply all
Reply to author
Forward
0 new messages