google-code-export / gdata-python-client

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

finance code broken #383

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download gdata-2.0.10
2. Run samples/finance/test_finance.py

What is the expected output? What do you see instead?
I would expect the sample to run. However, I get an error indicating 'Invalid 
portflio ID' as shown below:

python test_finance.py username@gmail.com password
===== TEST CASE 0 ==================================================
@ TestShowDetails () {}
Portfolio Title   : My Portfolio
Portfolio ID      : 
http%3A%2F%2Ffinance.google.com%2Ffinance%2Ffeeds%2Fusername%40gmail.com%2Fportf
olios%2F3
  Last updated    : 2010-06-18T03:31:29.000Z
  Currency        : USD

Traceback (most recent call last):
  File "test_finance.py", line 301, in <module>
    tests[int(i)]()
  File "test_finance.py", line 112, in wrap
    meth(*args, **kwargs)
  File "test_finance.py", line 148, in TestShowDetails
    positions = self.GetPositions(pfl, with_returns, inline_transactions)
  File "test_finance.py", line 132, in GetPositions
    return self.client.GetPositionFeed(portfolio, query=query).entry
  File "/usr/local/lib/python2.6/dist-packages/gdata/finance/service.py", line 120, in GetPositionFeed
    return self.Get(uri, converter=gdata.finance.PositionFeedFromString)
  File "/usr/local/lib/python2.6/dist-packages/gdata/service.py", line 1108, in Get
    'reason': server_response.reason, 'body': result_body}
gdata.service.RequestError: {'status': 400, 'body': 'Invalid portfolio ID 
http://finance.google.com/finance/feeds/username@gmail.com/portfolios/3', 
'reason': 'Bad Request'}

What version of the product are you using?
gdata-2.0.10

Please provide any additional information below.
Portfolio 3 does exist in my account.
Before running test_finance.py, I had tried to use it as an example to interact 
with my account. The only methods in the FinanceTester class that worked for me 
were GetPortfolios() and AddPortfolio(). Deleting a portfolio, or adding a 
transaction to a portfolio produced a similar Invalid Portfolio ID error to 
what is shown above. Note that the output above is from a pristine copy of 
test_finance.py from 2.0.10. I also attempted to use gdata-1.3.3, but that 
produced similar errors.

Original issue reported on code.google.com by mdschil...@gmail.com on 18 Jun 2010 at 4:40

GoogleCodeExporter commented 9 years ago
I did find that gdata-1.3.2 with the code in the .tgz linked to at 
http://groups.google.com/group/gdata-python-client-library-contributors/browse_t
hread/thread/78788dc4cef2db40 seems to work reasonably well.  

Original comment by mdschil...@gmail.com on 18 Jun 2010 at 5:46