On 2015-05-27 11:36, Adam Wolk wrote:

For net/py-oauth2 the __init__ file is empty.

FWIW, removing those files will cause 'make test' to fail. That said
currently the tests also fail, seems I missed that when I submitted
this port. Some googling led me to this:

http://lists.opensuse.org/archive/opensuse-commit/2013-04/msg01807.html

where they simply patch away the offending tests. I'm not sure why
this was the chosen path but the fact that upstream hasn't been
touched in four years might be a clue. So I adapted a similar patch
for the port and now 'make test' succeeds.

This "fixes" the port but doesn't address the original issue raised.
I'm not sure what the correct solution is here, however I will say
that I submitted this port as a dependency for py-discogs-client.
However once the current update gets commited py-oauth2 will cease to
be a dependency, as it seems pretty dead upstream I would have no
objections to it being removed at that time.

thanks,

.jh
$OpenBSD$
--- tests/test_oauth.py.orig	Tue May 26 05:47:24 2015
+++ tests/test_oauth.py	Tue May 26 05:43:21 2015
@@ -1193,41 +1193,6 @@ class TestClient(unittest.TestCase):
         except ValueError:
             pass
 
-    def test_access_token_get(self):
-        """Test getting an access token via GET."""
-        client = oauth.Client(self.consumer, None)
-        resp, content = client.request(self._uri('request_token'), "GET")
-
-        self.assertEquals(int(resp['status']), 200)
-
-    def test_access_token_post(self):
-        """Test getting an access token via POST."""
-        client = oauth.Client(self.consumer, None)
-        resp, content = client.request(self._uri('request_token'), "POST")
-
-        self.assertEquals(int(resp['status']), 200)
-
-        res = dict(parse_qsl(content))
-        self.assertTrue('oauth_token' in res)
-        self.assertTrue('oauth_token_secret' in res)
-
-    def _two_legged(self, method):
-        client = oauth.Client(self.consumer, None)
-
-        return client.request(self._uri('two_legged'), method,
-            body=urllib.urlencode(self.body))
-
-    def test_two_legged_post(self):
-        """A test of a two-legged OAuth POST request."""
-        resp, content = self._two_legged("POST")
-
-        self.assertEquals(int(resp['status']), 200)
-
-    def test_two_legged_get(self):
-        """A test of a two-legged OAuth GET request."""
-        resp, content = self._two_legged("GET")
-        self.assertEquals(int(resp['status']), 200)
-
     @mock.patch('httplib2.Http.request')
     def test_multipart_post_does_not_alter_body(self, mockHttpRequest):
         random_result = random.randint(1,100)
? py-oauth2/patches
Index: py-oauth2/Makefile
===================================================================
RCS file: /cvs/ports/net/py-oauth2/Makefile,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 Makefile
--- py-oauth2/Makefile	2 Apr 2015 14:21:16 -0000	1.2
+++ py-oauth2/Makefile	27 May 2015 19:24:21 -0000
@@ -5,6 +5,7 @@ COMMENT =	Python library for OAuth
 MODPY_EGG_VERSION = 1.5.211
 DISTNAME =	oauth2-${MODPY_EGG_VERSION}
 PKGNAME =	py-${DISTNAME}
+REVISION=	1
 CATEGORIES =	net
 MAINTAINER =	Johan Huldtgren <jhuldtg...@gmail.com>
 
@@ -19,5 +20,9 @@ MODULES =	lang/python
 MODPY_SETUPTOOLS = Yes
 
 RUN_DEPENDS =	www/py-httplib2
+
+TEST_DEPENDS =	devel/py-mock \
+		devel/py-coverage \
+		${RUN_DEPENDS}
 
 .include <bsd.port.mk>

Reply via email to