Exemplo n.º 1
0
 def test_rate_history(self, m):
     fake_response = {
         "message": "Success",
     }
     m.get('https://api.casiregalii.com/rates/history',
           text=json.dumps(fake_response))
     client = v30.Client(config)
     client.rate.history()
Exemplo n.º 2
0
 def test_transaction(self, m):
     fake_response = {
         "message": "Success",
     }
     m.get('https://api.casiregalii.com/transactions',
           text=json.dumps(fake_response))
     client = v30.Client(config)
     client.transaction.list()
Exemplo n.º 3
0
 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 = v30.Client(config)
     client.bill.list({'page': 2})
Exemplo n.º 4
0
 def test_biller_utilities(self, m):
     fake_response = {
         "message": "Success",
     }
     m.get('https://api.casiregalii.com/billers/utilities',
           text=json.dumps(fake_response))
     client = v30.Client(config)
     client.biller.utilities()
Exemplo n.º 5
0
 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 = v30.Client(config)
     client.bill.xdata(1)
Exemplo n.º 6
0
 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 = v30.Client(config)
     client.bill.pay(1)
Exemplo n.º 7
0
 def test_bill_delete(self, m):
     fake_response = {
         "message": "Success",
     }
     m.delete('https://api.casiregalii.com/bills/1',
              text=json.dumps(fake_response))
     client = v30.Client(config)
     client.bill.delete(1)
Exemplo n.º 8
0
 def test_account_info(self, m):
     fake_response = {
         "message": "Success",
     }
     m.get('https://api.casiregalii.com/account',
           text=json.dumps(fake_response))
     client = v30.Client(config)
     client.account.info()
Exemplo n.º 9
0
 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 = v30.Client(config)
     r = client.account.info()
     self.assertResponse(r, test_data)
Exemplo n.º 10
0
    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=v30.API_VERSION),
                    'Content-type':
                    Request.CONTENT_TYPE,
                    'Content-MD5':
                    '3BEWLu/j40CHTOKvxiNSoA==',
                    'Date':
                    test_date,
                    'Authorization':
                    'APIAuth api-key:dmB6JzS3/j5DmXcvyc006o6Hqo8=',
                })

        client = v30.Client(config)
        client.bill.update(10, {"account_number": "4222422244"})
Exemplo n.º 11
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=v30.API_VERSION),
                   'Content-type':
                   Request.CONTENT_TYPE,
                   'Content-MD5':
                   'Ilbcl2g1pg0HM6IhZrAoow==',
                   'Date':
                   test_date,
                   'Authorization':
                   'APIAuth api-key:Co1ZsmgTbUPUKhmO6KMcIMERHHw=',
               })

        client = v30.Client(config)
        client.bill.create({"biller_id": 37, "account_number": "4222422244"})
Exemplo n.º 12
0
    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=v30.API_VERSION),
                  'Content-type':
                  Request.CONTENT_TYPE,
                  'Content-MD5':
                  '',
                  'Date':
                  test_date,
                  'Authorization':
                  'APIAuth api-key:STh6oN8xVXjtuw4OcSKraYKrzuo=',
              })

        client = v30.Client(config)
        client.bill.list({'page': 2})
Exemplo n.º 13
0
    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=v30.API_VERSION),
                  'Content-type':
                  Request.CONTENT_TYPE,
                  'Content-MD5':
                  '',
                  'Date':
                  test_date,
                  'Authorization':
                  'APIAuth api-key:cBkqHFHRxtXiuFhDJMyjk7NwZp0=',
              })

        client = v30.Client(config)
        client.account.info()
Exemplo n.º 14
0
 def test_bill_bulk_refresh(self, m):
     fake_response = {"message": "Success"}
     m.post('https://api.casiregalii.com/bills/bulk_refresh',
            text=json.dumps(fake_response))
     client = v30.Client(config)
     client.bill.bulk_refresh({'bill_ids': [1, 2, 3]})