class ClientTests(unittest.TestCase): def setUp(self): self.client = HtApiClient(auth_token='9vi73Q0g7dVnOneiPT47Bf7bdmfG2rvBqyW40yx56NaSrBaqjPzyxgzP0dV47BwUNCf6UAf2UGIMcOjo4Y9R') @httprettified def test_post(self): HTTPretty.register_uri(HTTPretty.POST, "https://api.holytransaction.com/api/v1/ofac", body='''{"k":"v"}''', content_type='text/json') this(self.client.post("ofac", {'c': "d"})).should.equal({'k': "v"}) @httprettified def test_get(self): HTTPretty.register_uri(HTTPretty.GET, "https://api.holytransaction.com/api/v1/balances", body='''{"k":"v"}''', content_type='text/json') this(self.client.get("balances")).should.equal({'k': "v"})
def setUp(self): self.client = HtApiClient(auth_token='9vi73Q0g7dVnOneiPT47Bf7bdmfG2rvBqyW40yx56NaSrBaqjPzyxgzP0dV47BwUNCf6UAf2UGIMcOjo4Y9R')
__author__ = 'nixoid' from holytransaction import HtApiClient ht_api = HtApiClient(auth_token='9vi73Q0g7dVnOneiPT47Bf7bdmfG2rvBqyW40yx56NaSrBaqjPzyxgzP0dV47BwUNCf6UAf2UGIMcOjo4Y9R') # ht_api.endpoint = 'http://localhost:3000/api/v1/' ofac_result = ht_api.post("ofac", {'name': "Delgado, Jorge Armando"}) print ofac_result