예제 #1
0
 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()
예제 #2
0
 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()
예제 #3
0
 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()
예제 #4
0
 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()
예제 #5
0
 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()
예제 #6
0
 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)
예제 #7
0
    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})
예제 #8
0
    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()