def test_transaction(self, m): fake_response = { "message": "Success", } m.get('https://api.casiregalii.com/transactions', text=json.dumps(fake_response)) client = v32.Client(config) client.transaction.list()
def test_biller_utilities(self, m): fake_response = { "message": "Success", } m.get('https://api.casiregalii.com/billers/utilities', text=json.dumps(fake_response)) client = v32.Client(config) client.biller.utilities()
def test_rate_history(self, m): fake_response = { "message": "Success", } m.get('https://api.casiregalii.com/rates/history', text=json.dumps(fake_response)) client = v32.Client(config) client.rate.history()
def test_bill_list_page(self, m): fake_response = { "message": "Success", } m.get('https://api.casiregalii.com/bills?page=2', text=json.dumps(fake_response)) client = v32.Client(config) client.bill.list({'page': 2})
def test_bill_xdata(self, m): fake_response = { "message": "Success", } m.get('https://api.casiregalii.com/bills/1/xdata', text=json.dumps(fake_response)) client = v32.Client(config) client.bill.xdata(1)
def test_bill_pay(self, m): fake_response = { "message": "Success", } m.post('https://api.casiregalii.com/bills/1/pay', text=json.dumps(fake_response)) client = v32.Client(config) client.bill.pay(1)
def test_bill_update(self, m): fake_response = { "message": "Success", } m.patch('https://api.casiregalii.com/bills/1', text=json.dumps(fake_response)) client = v32.Client(config) client.bill.update(1)
def test_account_info(self, m): fake_response = { "message": "Success", } m.get('https://api.casiregalii.com/account', text=json.dumps(fake_response)) client = v32.Client(config) client.account.info()
def test_data_response(self, m): test_data = { "name": "ACME Company", "balance": 100, "minimum_balance": 100, "currency": "USD" } m.get('https://api.casiregalii.com/account', text=json.dumps(test_data)) client = v32.Client(config) r = client.account.info() self.assertResponse(r, test_data)
def test_header_patch_params(self, m, _): m.patch('https://api.casiregalii.com/bills/10', request_headers={ 'User-Agent': VERSION, 'Accept': 'application/vnd.regalii.v{version}+json'.format( version=v32.API_VERSION), 'Content-type': Request.CONTENT_TYPE, 'Content-MD5': '3BEWLu/j40CHTOKvxiNSoA==', 'Date': test_date, 'Authorization': 'APIAuth api-key:dmB6JzS3/j5DmXcvyc006o6Hqo8=', }) client = v32.Client(config) client.bill.update(10, {"account_number": "4222422244"})
def test_header_post_params(self, m, _): m.post('https://api.casiregalii.com/bills', request_headers={ 'User-Agent': VERSION, 'Accept': 'application/vnd.regalii.v{version}+json'.format( version=v32.API_VERSION), 'Content-type': Request.CONTENT_TYPE, 'Content-MD5': 'Ilbcl2g1pg0HM6IhZrAoow==', 'Date': test_date, 'Authorization': 'APIAuth api-key:Co1ZsmgTbUPUKhmO6KMcIMERHHw=', }) client = v32.Client(config) client.bill.create({"biller_id": 37, "account_number": "4222422244"})
def test_header_get_params(self, m, _): m.get('https://api.casiregalii.com/bills?page=2', request_headers={ 'User-Agent': VERSION, 'Accept': 'application/vnd.regalii.v{version}+json'.format( version=v32.API_VERSION), 'Content-type': Request.CONTENT_TYPE, 'Content-MD5': '', 'Date': test_date, 'Authorization': 'APIAuth api-key:STh6oN8xVXjtuw4OcSKraYKrzuo=', }) client = v32.Client(config) client.bill.list({'page': 2})
def test_header(self, m, _): m.get('https://api.casiregalii.com/account', request_headers={ 'User-Agent': VERSION, 'Accept': 'application/vnd.regalii.v{version}+json'.format( version=v32.API_VERSION), 'Content-type': Request.CONTENT_TYPE, 'Content-MD5': '', 'Date': test_date, 'Authorization': 'APIAuth api-key:cBkqHFHRxtXiuFhDJMyjk7NwZp0=', }) client = v32.Client(config) client.account.info()