Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Rename BalancedHarness to BillingHarness
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitpaulk committed May 9, 2015
1 parent f0c2950 commit f1b2814
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions gratipay/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ def make_exchange(self, route, amount, fee, participant, status='succeeded', err
network = route
route = ExchangeRoute.from_network(participant, network)
if not route:
from .balanced import BalancedHarness
route = ExchangeRoute.insert(participant, network, BalancedHarness.card_href)
from .balanced import BillingHarness
route = ExchangeRoute.insert(participant, network, BillingHarness.card_href)
assert route
e_id = record_exchange(self.db, route, amount, fee, participant, 'pre')
record_exchange_result(self.db, e_id, status, error, participant)
Expand Down
8 changes: 4 additions & 4 deletions gratipay/testing/balanced.py → gratipay/testing/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from gratipay.testing.vcr import use_cassette


class BalancedHarness(Harness):
class BillingHarness(Harness):

def setUp(self):
self.david = self.make_participant('david', is_suspicious=False,
Expand All @@ -32,11 +32,11 @@ def tearDownClass(cls):
for t in itertools.chain(credits, debits):
t.meta.pop('exchange_id')
t.save()
super(BalancedHarness, cls).tearDownClass()
super(BillingHarness, cls).tearDownClass()


with use_cassette('BalancedHarness'):
cls = BalancedHarness
with use_cassette('BillingHarness'):
cls = BillingHarness
balanced.configure(balanced.APIKey().save().secret)
mp = balanced.Marketplace.my_marketplace
if not mp:
Expand Down
8 changes: 4 additions & 4 deletions tests/py/test_billing_exchanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
from gratipay.models.exchange_route import ExchangeRoute
from gratipay.models.participant import Participant
from gratipay.testing import Foobar, Harness
from gratipay.testing.balanced import BalancedHarness
from gratipay.testing.billing import BillingHarness


class TestCredits(BalancedHarness):
class TestCredits(BillingHarness):

def test_ach_credit_withhold(self):
self.make_exchange('balanced-cc', 27, 0, self.homer)
Expand Down Expand Up @@ -61,7 +61,7 @@ def test_ach_credit_invalidated_bank_account(self):
assert error == 'No bank account'


class TestCardHolds(BalancedHarness):
class TestCardHolds(BillingHarness):

def test_create_card_hold_for_suspicious_raises_NotWhitelisted(self):
bob = self.make_participant('bob', is_suspicious=True,
Expand Down Expand Up @@ -335,7 +335,7 @@ def test_record_exchange_result_updates_balance_for_positive_amounts(self):
assert alice.balance == D('35.59')


class TestSyncWithBalanced(BalancedHarness):
class TestSyncWithBalanced(BillingHarness):

def test_sync_with_balanced(self):
with mock.patch('gratipay.billing.exchanges.record_exchange_result') as rer:
Expand Down
6 changes: 3 additions & 3 deletions tests/py/test_billing_payday.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
from gratipay.exceptions import NegativeBalance
from gratipay.models.participant import Participant
from gratipay.testing import Foobar, Harness
from gratipay.testing.balanced import BalancedHarness
from gratipay.testing.billing import BillingHarness
from gratipay.testing.emails import EmailHarness


class TestPayday(BalancedHarness):
class TestPayday(BillingHarness):

@mock.patch.object(Payday, 'fetch_card_holds')
def test_payday_moves_money(self, fch):
Expand Down Expand Up @@ -253,7 +253,7 @@ def test_payday(self, payin, log):
assert payin.call_count == 1


class TestPayin(BalancedHarness):
class TestPayin(BillingHarness):

def create_card_holds(self):
payday = Payday.start()
Expand Down
4 changes: 2 additions & 2 deletions tests/py/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import balanced
import mock

from gratipay.testing.balanced import BalancedHarness
from gratipay.testing.billing import BillingHarness
from gratipay.models.exchange_route import ExchangeRoute
from gratipay.models.participant import Participant


class TestRoutes(BalancedHarness):
class TestRoutes(BillingHarness):

def hit(self, username, action, network, address, expected=200):
r = self.client.POST('/%s/routes/%s.json' % (username, action),
Expand Down

0 comments on commit f1b2814

Please sign in to comment.