Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

Commit

Permalink
#v2.4 - Dependency update (#13)
Browse files Browse the repository at this point in the history
- Dependency updates
- Unit test updates
- CI map updated
  • Loading branch information
Antonio Buedo authored May 22, 2019
1 parent 3f45611 commit 9654bd4
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 34 deletions.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
language: python
python: 3.4
python:
- "3.4"
- "3.5"
- "3.6"
install:
- pip install .
- pip install -r requirements.txt
script:
- nosetests --with-coverage --cover-package=bitpay --cover-html
- behave
script:
- nosetests --with-coverage --cover-package=bitpay --cover-html
after_success:
- coveralls
9 changes: 4 additions & 5 deletions examples/test_merchant_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
import pprint
import requests
import json
import re
import os.path

#API_HOST = "https://bitpay.com" #for production, live bitcoin
API_HOST = "https://test.bitpay.com" #for testing, testnet bitcoin
KEY_FILE = "/tmp/key.priv"
TOKEN_FILE = "/tmp/token.priv"
KEY_FILE = "tmp/key.priv"
TOKEN_FILE = "tmp/token.priv"

# check if there is a preexisting key file
if os.path.isfile(KEY_FILE):
Expand Down Expand Up @@ -39,7 +38,7 @@ def fetch_token(facade):
pairingCode = client.create_token(facade)
print("Creating " + facade + " token.")
print("Please go to: %s/dashboard/merchant/api-tokens then enter \"%s\" then click the \"Find\" button, then click \"Approve\"" % (API_HOST, pairingCode))
raw_input("When you've complete the above, hit enter to continue...")
input("When you've complete the above, hit enter to continue...")
print("token is: %s" % client.tokens[facade])
f = open(TOKEN_FILE + facade, 'w')
f.write(client.tokens[facade])
Expand Down Expand Up @@ -99,7 +98,7 @@ def post_to_bitpay_api(client, uri, resource, params):
print("continuing if we can...")


invoiceId = "REPLACE_BY_VALID_INVOICEID"
invoiceId = invoice['id']
print("**")
print("Now fetching an invoice with invoiceId " + invoiceId)
print("**")
Expand Down
5 changes: 2 additions & 3 deletions examples/test_payouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import pprint
import requests
import json
import re
import os.path

#API_HOST = "https://bitpay.com" #for production, live bitcoin
Expand Down Expand Up @@ -38,7 +37,7 @@ def fetch_token(facade):
pairingCode = client.create_token(facade)
print("Creating " + facade + " token.")
print("Please go to: %s/dashboard/merchant/api-tokens then enter \"%s\" then click the \"Find\" button, then click \"Approve\"" % (API_HOST, pairingCode))
raw_input("When you've complete the above, hit enter to continue...")
input("When you've complete the above, hit enter to continue...")
print("token is: %s" % client.tokens[facade])
f = open(TOKEN_FILE + facade, 'w')
f.write(client.tokens[facade])
Expand Down Expand Up @@ -89,7 +88,7 @@ def post_to_bitpay_api(client, uri, resource, params):
print("Creating a payout batch now")
print("token = " + token)
# posting a payout batch
params = {"token":token, "notificationURL":"http://test.merchant.com/IPNlogger.php", "notificationEmail":"[email protected]", "effectiveDate":"2017-08-23", "amount":"400","currency":"USD","instructions":[ {"label":"Test1","address":"mzDTjhkfJfatXHRUWKcE2BXxHt4Pfz2PK7","amount":"300"},{"label":"Test2","address":"mfadguj41aYgEwPATAFnkKcKQNqhpNTrdi","amount":"100"}]}
params = {"token":token, "notificationURL":"https://hookb.in/3OBkOPk23ouKeKj2M2WQ", "effectiveDate":"2019-05-21", "amount":"10","currency":"USD","instructions":[ {"label":"Test1","address":"mx2Wv5j8SrPnxAQtNB3uf8mii1Vc5UDKsZ","amount":"7"},{"label":"Test2","address":"mx2Wv5j8SrPnxAQtNB3uf8mii1Vc5UDKsZ","amount":"3"}]}
payoutBatch = post_to_bitpay_api(client, "https://test.bitpay.com", "payouts", params)
pp.pprint(payoutBatch)

29 changes: 16 additions & 13 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
behave==1.2.5
ecdsa==0.13
httmock==1.2.2
nose==1.3.4
parse==1.6.6
parse-type==0.3.4
pymongo==2.8
requests==2.5.1
selenium==2.44.0
six==1.9.0
splinter==0.7.0
virtualenv==12.0.7
coveralls
certifi==2019.3.9
chardet==3.0.4
coverage==4.5.3
coveralls==1.7.0
docopt==0.6.2
ecdsa==0.13.2
httmock==1.3.0
idna==2.8
nose==1.3.7
parse==1.12.0
pymongo==3.8.0
requests==2.21.0
selenium==3.141.0
splinter==0.10.0
urllib3==1.25.2
virtualenv==16.6.0
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
setup(
name = "bitpay",
packages = ["bitpay"],
version = "2.3.3",
version = "2.4.1905",
description = "Accept bitcoin with BitPay",
author = "BitPay Integrations Team",
author_email = "integrations@bitpay.com",
author_email = "sales-engineering@bitpay.com",
url = "https://github.com/bitpay/bitpay-python",
download_url = "https://github.com/bitpay/bitpay-python/tarball/v2.3.3",
download_url = "https://github.com/bitpay/bitpay-python/tarball/v2.4.1905",
keywords = ["bitcoin", "payments", "crypto"],
install_requires = ["requests", "ecdsa"],
classifiers = [
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3 :: Only",
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
Expand Down
5 changes: 2 additions & 3 deletions test/client_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from bitpay.exceptions import *
from bitpay.client import Client
from httmock import urlmatch, HTTMock
import requests
from httmock import HTTMock
import unittest

class TestClient(unittest.TestCase):
def test_pair_code_check(self):
"""tests whether the pairing code is syntatically correct"""
new_client = Client()
new_client = Client(api_uri="https://test.bitpay.com")
with self.assertRaisesRegex(BitPayArgumentError, "pairing code is not legal"):
new_client.pair_pos_client("abcd")

Expand Down
2 changes: 1 addition & 1 deletion test/key_utils_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from bitpay import key_utils as utils
import re
import unittest
from ecdsa import SigningKey, SECP256k1, VerifyingKey
from ecdsa import SigningKey
from ecdsa import util as ecdsaUtil
import binascii
import hashlib
Expand Down

0 comments on commit 9654bd4

Please sign in to comment.