From f1b28140fd6f6a119a210420225e63911173d108 Mon Sep 17 00:00:00 2001 From: Rohit Paul Kuruvilla Date: Sat, 9 May 2015 17:50:13 +0530 Subject: [PATCH] Rename BalancedHarness to BillingHarness --- gratipay/testing/__init__.py | 4 ++-- gratipay/testing/{balanced.py => billing.py} | 8 ++++---- .../fixtures/{BalancedHarness.yml => BillingHarness.yml} | 0 tests/py/test_billing_exchanges.py | 8 ++++---- tests/py/test_billing_payday.py | 6 +++--- tests/py/test_routes.py | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) rename gratipay/testing/{balanced.py => billing.py} (94%) rename tests/py/fixtures/{BalancedHarness.yml => BillingHarness.yml} (100%) diff --git a/gratipay/testing/__init__.py b/gratipay/testing/__init__.py index 29713d2385..60eb5f3eba 100644 --- a/gratipay/testing/__init__.py +++ b/gratipay/testing/__init__.py @@ -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) diff --git a/gratipay/testing/balanced.py b/gratipay/testing/billing.py similarity index 94% rename from gratipay/testing/balanced.py rename to gratipay/testing/billing.py index dfbb1dd8ca..129a3ec0d0 100644 --- a/gratipay/testing/balanced.py +++ b/gratipay/testing/billing.py @@ -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, @@ -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: diff --git a/tests/py/fixtures/BalancedHarness.yml b/tests/py/fixtures/BillingHarness.yml similarity index 100% rename from tests/py/fixtures/BalancedHarness.yml rename to tests/py/fixtures/BillingHarness.yml diff --git a/tests/py/test_billing_exchanges.py b/tests/py/test_billing_exchanges.py index 478aeff4bb..059db83c69 100644 --- a/tests/py/test_billing_exchanges.py +++ b/tests/py/test_billing_exchanges.py @@ -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) @@ -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, @@ -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: diff --git a/tests/py/test_billing_payday.py b/tests/py/test_billing_payday.py index 5bb4a82730..049947b54e 100644 --- a/tests/py/test_billing_payday.py +++ b/tests/py/test_billing_payday.py @@ -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): @@ -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() diff --git a/tests/py/test_routes.py b/tests/py/test_routes.py index 2de83d42e7..11f9a4f717 100644 --- a/tests/py/test_routes.py +++ b/tests/py/test_routes.py @@ -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),