Skip to content

Commit

Permalink
Merge pull request #31 from usabilla/task/fix-urlib
Browse files Browse the repository at this point in the history
Drop urllib3 usage
  • Loading branch information
rdohms authored Aug 15, 2023
2 parents db49c29 + 0499961 commit d83f32d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
15 changes: 7 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
coverage==4.0.3
python-coveralls==2.7.0
PyYAML==4.2b1
requests==2.20.0
sh==1.11
six==1.10.0
urllib3==1.23
mock==2.0.0
coverage==7.3.0
python-coveralls==2.9.3
PyYAML==6.0.1
requests==2.31.0
sh==2.0.6
six==1.16.0
mock==5.1.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
version=VERSION,
description="Python client for Usabilla API",
license='MIT',
install_requires=['urllib3', 'requests'],
install_requires=['requests'],
packages=find_packages(),
py_modules=['usabilla'],
author='Usabilla',
Expand Down
3 changes: 3 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def test_query_parameters(self):
params = {'limit': 1, 'since': 1235454}
self.client.set_query_parameters(params)
self.assertEqual(self.client.get_query_parameters(), 'limit=1&since=1235454')
params = {'limit': 1, 'since': 1235454, 'text': 'the little old lady'}
self.client.set_query_parameters(params)
self.assertEqual(self.client.get_query_parameters(), 'limit=1&since=1235454&text=the+little+old+lady')

def test_check_resource_validity(self):
with self.assertRaises(ub.GeneralError):
Expand Down
4 changes: 2 additions & 2 deletions usabilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import hashlib
import hmac
import requests
import urllib3.request as urllib
import urllib.parse

from collections import OrderedDict

Expand Down Expand Up @@ -153,7 +153,7 @@ def set_query_parameters(self, parameters):
:type parameters: dict
"""

self.query_parameters = urllib.urlencode(OrderedDict(sorted(parameters.items())))
self.query_parameters = urllib.parse.urlencode(OrderedDict(sorted(parameters.items())))

def get_query_parameters(self):
"""Get the query parameters."""
Expand Down

0 comments on commit d83f32d

Please sign in to comment.