Commit 843e5488 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis

astakosclient: Rename some functions

parent 2b0a9c6a
......@@ -406,8 +406,8 @@ class AstakosClient():
# ----------------------------------
# POST "astakos/api/commissions/<serial>/action"
def issue_commission_action(self, token, serial, action):
"""Issue a commission action
def commission_action(self, token, serial, action):
"""Perform a commission action
Keyword arguments:
token -- user's token (string)
......@@ -418,7 +418,7 @@ class AstakosClient():
"""
if not serial:
m = "Commissions serial not given"
m = "Commission's serial not given"
self.logger.error(m)
raise BadValue(m)
if not action:
......@@ -431,13 +431,13 @@ class AstakosClient():
req_body = parse_request({str(action): ""}, self.logger)
self._call_astakos(token, path, req_headers, req_body, "POST")
def issue_commission_accept(self, token, serial):
"""Issue a commission accept (see issue_commission_action)"""
self.issue_commission_action(token, serial, "accept")
def accept_commission(self, token, serial):
"""Accept a commission (see commission_action)"""
self.commission_action(token, serial, "accept")
def issue_commission_reject(self, token, serial):
"""Issue a commission reject (see issue_commission_reject)"""
self.issue_commission_action(token, serial, "reject")
def reject_commission(self, token, serial):
"""Reject a commission (see commission_action)"""
self.commission_action(token, serial, "reject")
# --------------------------------------------------------------------
......
......@@ -886,7 +886,7 @@ class TestQuotas(unittest.TestCase):
class TestCommissions(unittest.TestCase):
"""Test cases for function issue_commision"""
"""Test cases for quota commissions"""
# ----------------------------------
def test_issue_commission(self):
......@@ -973,13 +973,13 @@ class TestCommissions(unittest.TestCase):
self.fail("Should have raise BadValue")
# ----------------------------------
def test_issue_commision_action(self):
"""Test function call of issue_commision_action with wrong action"""
def test_commision_action(self):
"""Test function call of commision_action with wrong action"""
global token_1
_mock_request([_request_ok])
try:
client = AstakosClient("https://example.com")
client.issue_commission_action(token_1, 57, "lala")
client.commission_action(token_1, 57, "lala")
except BadRequest:
pass
except Exception as err:
......@@ -988,24 +988,24 @@ class TestCommissions(unittest.TestCase):
self.fail("Should have raised BadRequest")
# ----------------------------------
def test_issue_commission_accept(self):
"""Test function call of issue_commission_accept"""
def test_accept_commission(self):
"""Test function call of accept_commission"""
global token_1
_mock_request([_request_ok])
try:
client = AstakosClient("https://example.com")
client.issue_commission_accept(token_1, 57)
client.accept_commission(token_1, 57)
except Exception as err:
self.fail("Shouldn't raise Exception %s" % err)
# ----------------------------------
def test_issue_commission_reject(self):
"""Test function call of issue_commission_reject"""
def test_reject_commission(self):
"""Test function call of reject_commission"""
global token_1
_mock_request([_request_ok])
try:
client = AstakosClient("https://example.com")
client.issue_commission_reject(token_1, 57)
client.reject_commission(token_1, 57)
except Exception as err:
self.fail("Shouldn't raise Exception %s" % err)
......
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