Refactored atom.service and gdata.service

0 views
Skip to first unread message

Jeff S

unread,
Sep 3, 2008, 6:40:46 PM9/3/08
to GData Python Client Library Contributors
Hi all,

Over the past few weeks, I've been working on a major overhaul in how
HTTP requests are performed. I've uploaded a diff which contains my
proposed changes (see link at the end) and I've written a wiki page
which explains the new logic flow when an HTTP request is made:
http://code.google.com/p/gdata-python-client/wiki/HTTPRequestRefactoring

This is one of the most sweeping rewrites of functionality that this
library has seen. I have made sure that the core unit tests (included
in the all_tests scripts) pass, but there might be corner cases which
I have not caught that might break, so please let me know if you spot
any problems.

There were two main motivations for making the changes: 1. enabling
secure AuthSub and OAuth, which require dynamically calculated
authorization headers. and 2. improving token management storage
across multiple sessions on Google App Engine. Although the token
management issue is targeted for App Engine, the benefit should be
immedately usable in any environment.

Diff:
http://gdata-python-client-library-contributors.googlegroups.com/web/http_refactor.diff?gda=qzgd6UQAAADtVM-AX1fwIzaJXpJEaRyPzCUWA-O5Uwwa456NAFUZSaBfT76LlHPrw5So8Zw1z85V6u9SiETdg0Q2ffAyHU-dzc4BZkLnSFWX59nr5BxGqA

Thank you,

Jeff

Jeff S

unread,
Sep 3, 2008, 9:10:14 PM9/3/08
to GData Python Client Library Contributors
I forgot to mention that there is one unit test which I know will
break. There was a mock service object in the atom.mock_service module
but this module is now deprecated in favor of atom.mock_http. I
updated most of the unit tests, but I haven't updated tests/
gdata_tests/apps/service_test_using_mock.py so that test will be
broken. A fix will require re-recording live data to use as mocks.
(Sorry Takashi, I recall this was one that you wrote.)

Cheers,

Jeff

On Sep 3, 3:40 pm, Jeff S <j...@google.com> wrote:
> Hi all,
>
> Over the past few weeks, I've been working on a major overhaul in how
> HTTP requests are performed. I've uploaded a diff which contains my
> proposed changes (see link at the end) and I've written a wiki page
> which explains the new logic flow when an HTTP request is made:http://code.google.com/p/gdata-python-client/wiki/HTTPRequestRefactoring
>
> This is one of the most sweeping rewrites of functionality that this
> library has seen. I have made sure that the core unit tests (included
> in the all_tests scripts) pass, but there might be corner cases which
> I have not caught that might break, so please let me know if you spot
> any problems.
>
> There were two main motivations for making the changes: 1. enabling
> secure AuthSub and OAuth, which require dynamically calculated
> authorization headers. and 2. improving token management storage
> across multiple sessions on Google App Engine. Although the token
> management issue is targeted for App Engine, the benefit should be
> immedately usable in any environment.
>
> Diff:http://gdata-python-client-library-contributors.googlegroups.com/web/...
>
> Thank you,
>
> Jeff

Takashi Matsuo

unread,
Sep 4, 2008, 9:46:45 AM9/4/08
to gdata-python-client-...@googlegroups.com
Hi Jeff,

I don't mind at all :-)

I'll look into the code on this weekend, and ideally, I hope I can
re-write my unittest that you mentioned.
Looking back now, the unittest is not so good.

Regards,

Jeff S

unread,
Sep 5, 2008, 7:27:58 PM9/5/08
to GData Python Client Library Contributors
Hi Takashi,

Here are a couple of example tests which use the new mock_http module:

testValidHostName in tests/gdata_tests/calendar/service_test.py
testCaptchaUrlGeneration in tests/gdata_tests/service_test.py

Happy coding,

Jeff
Reply all
Reply to author
Forward
0 new messages