carolinux / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
0 stars 1 forks source link

atom_tests.mock_http_test.MockHttpClientUnitTest.testRecordResponse() fails #552

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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)

Original issue reported on code.google.com by Arfrever...@gmail.com on 19 Oct 2011 at 10:27

GoogleCodeExporter commented 9 years ago
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

Original comment by yiti...@google.com on 20 Nov 2011 at 4:13

GoogleCodeExporter commented 9 years ago
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.p
y: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/gd
ata-2.0.15-py2.7.egg-info
Writing 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gd
ata-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. 

Original comment by mcup...@uci.edu on 3 Jan 2012 at 2:47

GoogleCodeExporter commented 9 years ago
Confirmed on Debian unstable with gdata 2.0.16.

Original comment by Mitya57 on 2 Mar 2012 at 2:38

GoogleCodeExporter commented 9 years ago
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

Original comment by jfran...@schoolofrock.com on 7 Mar 2012 at 10:53

GoogleCodeExporter commented 9 years ago
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.

Original comment by Mitya57 on 22 Apr 2012 at 11:43

GoogleCodeExporter commented 9 years ago
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.

Original comment by aging.mi...@gmail.com on 5 Jul 2012 at 1:21

GoogleCodeExporter commented 9 years ago
Same problem with Python 2.7.1 on OS X 10.7.4.

Original comment by yed...@gmail.com on 17 Jul 2012 at 8:34

GoogleCodeExporter commented 9 years ago
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.

Original comment by orsha...@gmail.com on 11 Nov 2013 at 3:32

GoogleCodeExporter commented 9 years ago
Same issue here with 404 != 200 error.  On Ubuntu 12.04.  

Original comment by andrewjo...@gmail.com on 12 Nov 2013 at 4:32

GoogleCodeExporter commented 9 years ago
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

Original comment by unixtool...@gmail.com on 19 Dec 2013 at 3:43

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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'

Original comment by mikal.ma...@gmail.com on 30 Jan 2015 at 11:12

GoogleCodeExporter commented 9 years ago
Following Mikal's advice solved the problem for me - thanks very much.

Original comment by omnichro...@gmail.com on 26 Feb 2015 at 7:15