Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running test against other endpoint? #22

Open
julien51 opened this issue Apr 16, 2013 · 6 comments
Open

Running test against other endpoint? #22

julien51 opened this issue Apr 16, 2013 · 6 comments

Comments

@julien51
Copy link

We (@superfeedr) are trying to produce a compatible Google Reader API, so that it's easy for anyone to change their endpoint and still get their libraries to work.
To achieve that I wanted to know what needed to be changed to run the test suite against our endpoint.

Thanks!

@askedrelic
Copy link
Owner

Hey,

  • First, I would recommend cloning and installing the source locally, so you can tweak it, something like:

git clone git://github.com/askedrelic/libgreader.git
python setup develop

  1. Change the READER_BASE_URL to use your API
    this file: https://github.com/askedrelic/libgreader/blob/master/libgreader/url.py

You need to setup your username/password in the test file, along with changing the ClientAuth to be your new Auth class.

You can run the tests in that file, just by calling the file with python. "python test_special_auth.py" will run just the tests in the file.

@julien51
Copy link
Author

Thanks @askedrelic this is exactly what we needed.
I think we can go pretty far with that.

The gist you sent though has an error which I'm unable to understand:

$ python test_special_auth.py
Traceback (most recent call last):
  File "test_special_auth.py", line 14, in <module>
    echo_feed = [x for x in reader.feeds if "Echo" in x.title][0]
IndexError: list index out of range

Any idea what's going on? [it fails for both google reader and our own]

Well,n that's just because the feed was not subscribed and hence could not be extracted from the list.
I madde a lot of progress, more soon!

@julien51
Copy link
Author

I'm unable to run the test suite (probably due to my low python knowledge :p):

$ python tests/test_special_feeds.py
Traceback (most recent call last):
  File "tests/test_special_feeds.py", line 18, in <module>
    from libgreader import GoogleReader, OAuthMethod, ClientAuthMethod, Feed, ItemsContainer, Item, BaseFeed, SpecialFeed, ReaderUrl
ImportError: No module named libgreader

@julien51
Copy link
Author

Also, FYI, our Google Reader Compatible API is running at http://readerapi.superfeedr.com/
so you can just set READER_BASE_URL to https://readerapi.superfeedr.com/reader/api
and CLIENT_URL to http://readerapi.superfeedr.com/accounts/ClientLogin as we also mapped
Google's auth pattern.

We'd love to hear your thoughts.

@askedrelic
Copy link
Owner

The ImportError: No module named libgreader is mostly liking due to not having libgreader installed in 'develop' mode, which installs libgreader to point to your current files
If you are in the top level git repo, run python setup.py develop and it should "install" locally like so

(py2-libgreader)mbehrens at mattb in ~/.virtualenvs/py2-libgreader/reader on feature/superfeedrauth*
$ py setup.py develop
running develop
running egg_info
creating libgreader.egg-info
writing requirements to libgreader.egg-info/requires.txt
writing libgreader.egg-info/PKG-INFO
writing top-level names to libgreader.egg-info/top_level.txt
writing dependency_links to libgreader.egg-info/dependency_links.txt
writing manifest file 'libgreader.egg-info/SOURCES.txt'
reading manifest file 'libgreader.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'libgreader.egg-info/SOURCES.txt'
running build_ext
Creating /Users/mbehrens/.virtualenvs/py2-libgreader/lib/python2.7/site-packages/libgreader.egg-link (link to .)
Adding libgreader 0.8.0 to easy-install.pth file

Installed /Users/mbehrens/.virtualenvs/py2-libgreader/reader
Processing dependencies for libgreader==0.8.0
Searching for requests==1.2.0
Best match: requests 1.2.0
Adding requests 1.2.0 to easy-install.pth file

Using /Users/mbehrens/.virtualenvs/py2-libgreader/lib/python2.7/site-packages
Finished processing dependencies for libgreader==0.8.0

@askedrelic
Copy link
Owner

Signed up and got things working! Checkout my branch feature/superfeedauth

I created a SuperAuthMethod and a seperate test_superfeed.py. Fill in your username and password at the top of the file and then python run it. The user-info stuff works, but I'm category/feed stuff fails due to some Not supported errors. But it's something to work from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants