Commit 161ccf03 authored by Jeroen F.J. Laros's avatar Jeroen F.J. Laros

Added tests for the library interface.

parent 6f5e5106
......@@ -12,6 +12,7 @@ license = 'MIT License'
keywords = []
dependencies = ['requests', 'urllib3']
develop_dependencies = ['pytest', 'tox']
supported = [(2, 7), (3, 3), (3, 4)]
classifiers = [
'Development Status :: 3 - Alpha',
......@@ -71,6 +72,7 @@ setup(
platforms=['any'],
packages=[package],
install_requires=dependencies,
tests_require=develop_dependencies,
entry_points={
'console_scripts': ['{0} = {0}.cli:main'.format(package)]
},
......
"""
Tests for the transfer_client library.
"""
from io import StringIO
from transfer_client import TransferClient
class TestLibrary(object):
def setup(self):
TransferClient._request = lambda *args, **kwargs: None
self._transfer_client = TransferClient('127.0.0.1', False)
self._input_handle = StringIO()
def test_users(self):
assert self._transfer_client.users('123') == None
def test_schema(self):
assert self._transfer_client.schema('123') == None
def test_transfers(self):
assert self._transfer_client.transfers('123', {}) == None
def test_status(self):
assert self._transfer_client.status('123', '456') == None
def test_update(self):
assert self._transfer_client.update('123', '456', 'cancelled') == None
def test_uploads(self):
assert self._transfer_client.uploads(
'123', '456', self._input_handle) == None
def test_completed(self):
assert self._transfer_client.completed('789') == None
......@@ -23,7 +23,6 @@ class TransferClient(object):
except AttributeError:
sys.stderr = open('/dev/null')
def _request(self, method, endpoint, headers=None, files=None, json=None):
"""
Handle a request.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment