eve-val/evelink — pull request #165 by HapeMask (2014-04-26 21:06:29+00:00)
Title: Python 3 Compatibility

I've modified evelink so that it can be used seamlessly with Python 2 and 3. I don't know if there's any actual interest in this PR, but I try to work exclusively with Python 3 so I figured I'd make my changes available.

A note about the tests:
All tests pass fine with python 2 (2.7.6) except the appengine ones which I can't run myself.

In python 3, all tests pass except the following:
* test_member_list (tests.thirdparty.test_eve_who.EVEWhoTestCase)
* test_get_with_apikey (tests.test_api.APITestCase)
* test_get_with_apikey (tests.test_requests_api.RequestsAPITestCase)

This is because these tests compare the equality of strings generated from a dictionary. In python 3, dictionary elements are not ordered, and thus every time you run the test, the URLs generated from the dicts have the parameters in a random (but still correct) order. Python 2 happens to keep the same order of dictionary elements, thus the URLs generated from the dicts are the same every time.

If there's any interest, I'll look into actually fixing those tests. Existing projects that have run into this problem have included wrappers to force the dictionary items to be returned in a consistent order.