def test_bill_index(self, m): fake_response = { "message": "Success", } m.post('https://api.casiregalii.com/bills', text=json.dumps(fake_response)) client = v15.Client(config) client.bill.index()
def test_transaction_cancel(self, m): fake_response = { "message": "Success", } m.post('https://api.casiregalii.com/transactions/cancel', text=json.dumps(fake_response)) client = v15.Client(config) client.transaction.cancel()
def test_account_info(self, m): fake_response = { "message": "Success", } m.post('https://api.casiregalii.com/account', text=json.dumps(fake_response)) client = v15.Client(config) client.account.info()
def test_rate_history(self, m): fake_response = { "message": "Success", } m.post('https://api.casiregalii.com/rates/history', text=json.dumps(fake_response)) client = v15.Client(config) client.rate.history()
def test_biller_utilities(self, m): fake_response = { "message": "Success", } m.post('https://api.casiregalii.com/billers/utilities', text=json.dumps(fake_response)) client = v15.Client(config) client.biller.utilities()
def test_data_response(self, m): test_data = { "name": "ACME Company", "balance": 100, "minimum_balance": 100, "currency": "USD" } m.post('https://api.casiregalii.com/account', text=json.dumps(test_data)) client = v15.Client(config) r = client.account.info() self.assertResponse(r, test_data)
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=v15.API_VERSION), 'Content-type': Request.CONTENT_TYPE, 'Content-MD5': 'Ncu059yzRHSeil5s9h3KoA==', 'Date': test_date, 'Authorization': 'APIAuth api-key:ia+AJUkNIV9RV+GKgkjPIJJk2q4=', }) client = v15.Client(config) client.bill.index({"page": 2})
def test_header(self, m, _): m.post('https://api.casiregalii.com/account', request_headers={ 'User-Agent': VERSION, 'Accept': 'application/vnd.regalii.v{version}+json'.format( version=v15.API_VERSION), 'Content-type': Request.CONTENT_TYPE, 'Content-MD5': '', 'Date': test_date, 'Authorization': 'APIAuth api-key:cBkqHFHRxtXiuFhDJMyjk7NwZp0=', }) client = v15.Client(config) client.account.info()