Skip to content
Browse files

Merge branch 'master' into unnec-imports

  • Loading branch information...
2 parents 42fd80e + ae7cab3 commit e1471a614ca4fe376d44cf4dbc62e5b56a97b054 @alexjg alexjg committed
Showing with 27 additions and 7 deletions.
  1. +18 −0 README.rst
  2. +2 −0 requirements.txt
  3. +5 −5 test/test_client.py
  4. +2 −2 test/test_params.py
View
18 README.rst
@@ -37,3 +37,21 @@ active resource style API. For example, to get all of a merchants bills::
>>> merchant.bills()
>>> [<gocardless.resources.Bill at 0x29a6050>]
+Contribute
+==========
+
+Fork the repo then clone it to your machine and install in "develop" mode
+(preferably using a virtualenv)::
+
+ mkvirtualenv gocardless
+ git clone https://github.com/<username>/gocardless-python
+ cd gocardless-python
+ python setup.py develop
+
+Install the testing dependencies::
+
+ pip install -r requirements.txt
+
+and run the test suite::
+
+ nosetests
View
2 requirements.txt
@@ -0,0 +1,2 @@
+mock==0.8.0
+nose==1.1.2
View
10 test/test_client.py
@@ -83,10 +83,10 @@ def test_get_merchant(self):
self.assertEqual(merchant.id, self.account_details["merchant_id"])
def test_get_subscription(self):
- self.get_resource_tester("subscription", fixtures.subscription_json)
+ self._get_resource_tester("subscription", fixtures.subscription_json)
def test_get_user(self):
- self.get_resource_tester("user", create_mock_attrs({}))
+ self._get_resource_tester("user", create_mock_attrs({}))
def test_get_pre_authorization(self):
mock_date = datetime.datetime.now().isoformat()[:-7] + "Z"
@@ -95,15 +95,15 @@ def test_get_pre_authorization(self):
"expires_at":mock_date,
"next_interval_start":mock_date
}
- self.get_resource_tester("pre_authorization",
+ self._get_resource_tester("pre_authorization",
create_mock_attrs(mock_attrs))
def test_get_bill(self):
- self.get_resource_tester("bill", create_mock_attrs(
+ self._get_resource_tester("bill", create_mock_attrs(
{"paid_at":datetime.datetime.now().isoformat()[:-7] + "Z",
"user_id":"someuserid"}))
- def get_resource_tester(self, resource_name, resource_fixture):
+ def _get_resource_tester(self, resource_name, resource_fixture):
expected_klass = getattr(sys.modules["gocardless.resources"], utils.camelize(resource_name))
with patch.object(self.client, 'api_get'):
self.client.api_get.return_value = resource_fixture
View
4 test/test_params.py
@@ -20,7 +20,7 @@ def test_interval_unit_is_valid(self):
with self.assertRaises(ValueError):
pars = self.create_params(10, 10, "1432233123", "invalid")
- def future_date_tester(self, argname):
+ def _future_date_tester(self, argname):
invalid_date = datetime.datetime.now() - datetime.timedelta(100)
valid_date = datetime.datetime.now() + datetime.timedelta(2000)
par1 = self.create_params(10, 10, "23423421", "day", **{argname:valid_date})
@@ -29,7 +29,7 @@ def future_date_tester(self, argname):
**{argname:invalid_date})
def test_expires_at_in_future(self):
- self.future_date_tester("expires_at")
+ self._future_date_tester("expires_at")
def test_interval_count_positive(self):
with self.assertRaises(ValueError):

0 comments on commit e1471a6

Please sign in to comment.
Something went wrong with that request. Please try again.