Verified Commit 37142abd authored by Jan Koppe's avatar Jan Koppe
Browse files

lint

parent 892c6dab
Pipeline #1279 failed with stages
in 40 seconds
......@@ -23,7 +23,8 @@ DEFAULT_API_VERSION = "v1.0.0"
class ApiClient():
def __init__(self, host, user='admin', password='opencast', api_version=DEFAULT_API_VERSION):
def __init__(self, host, user='admin', password='opencast',
api_version=DEFAULT_API_VERSION):
# Account credentials to authenticate with against the API. make sure
# that this account has the required API_* roles for your desired
......@@ -64,7 +65,9 @@ class ApiClient():
url = urllib.parse.urljoin(self.server_url, '/api' + path)
logger.debug(parameters)
return requests.request(method, url, auth=(self.auth_user, self.auth_password), params=parameters, **kwargs)
return requests.request(method, url,
auth=(self.auth_user, self.auth_password),
params=parameters, **kwargs)
def get_json(self, path, **kwargs):
r = self.req(path, **kwargs)
......
......@@ -23,7 +23,8 @@ class Groups(ApiClient):
def get_groups(self, **kwargs) -> dict():
return self.get_json('/groups', **kwargs)
def create_group(self, name, desc="", roles=[], members=[], **kwargs) -> bool():
def create_group(self, name, desc="", roles=[], members=[],
**kwargs) -> bool():
roles.append('ROLE_GROUP_%s' % name)
......
......@@ -31,4 +31,5 @@ class TestApiClient(unittest.TestCase):
self.assertEqual(data['version'], self.API_VERSION)
self.assertIn(r.headers.get('content-type'),
['application/json', 'application/%s+json' % self.API_VERSION])
['application/json', 'application/%s+json'
% self.API_VERSION])
......@@ -24,7 +24,7 @@ class TestGroups(unittest.TestCase):
GROUP_NAME = 'test_group'
def setUp(self):
self.api = ExternalApi(host='http://localhost:8080') # TODO: CHANGE ME!
self.api = ExternalApi(host='http://localhost:8080') # TODO: CHANGE
def test_get_groups(self):
groups = self.api.get_groups()
......
Supports Markdown
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