From c08df86313169f6db5f8bb327cb368987d85e881 Mon Sep 17 00:00:00 2001 From: Rohit Paul Kuruvilla Date: Sat, 9 May 2015 17:21:09 +0530 Subject: [PATCH] Rename BalancedHarness to BillingHarness --- 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 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) rename gratipay/testing/{balanced.py => billing.py} (94%) rename tests/py/fixtures/{BalancedHarness.yml => BillingHarness.yml} (100%) 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 0d905a4840..7c38962d03 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, @@ -26,7 +26,7 @@ def setUp(self): @classmethod def setUpClass(cls): - with use_cassette('BalancedHarness'): + with use_cassette('BillingHarness'): balanced.configure(balanced.APIKey().save().secret) mp = balanced.Marketplace.my_marketplace if not mp: @@ -65,7 +65,7 @@ def setUpClass(cls): cls.bank_account.associate_to_customer(cls.homer_href) cls.bank_account_href = unicode(cls.bank_account.href) - super(BalancedHarness, cls).setUpClass() + super(BillingHarness, cls).setUpClass() @classmethod def tearDownClass(cls): @@ -75,7 +75,7 @@ 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() 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),