예제 #1
0
 def test_should_setup_provider_reference_text_if_set(self):
     self.setup_ok_response()
     yo = Yo("username", "password")
     mock = MagicMock()
     yo.client = mock
     reference = "some reference"
     reason = "for some reason"
     Account = "+123"
     yo.withdraw_funds(200, Account, reason, provider_reference_text=reference)
     yo.client.make_request.assert_called_with(self.get_method(), Amount=200,
                                               ProviderReferenceText=reference, Account=Account,
                                               NonBlocking='FALSE', Narrative=reason)
예제 #2
0
 def test_should_setup_external_reference_if_set(self):
     self.setup_ok_response()
     yo = Yo("username", "password")
     mock = MagicMock()
     yo.client = mock
     reference = "some reference"
     reason = "for some reason"
     Account = "123"
     yo.withdraw_funds(200, Account, reason, external_reference=reference)
     yo.client.make_request.assert_called_with(self.get_method(),
                                               Amount=200,
                                               ExternalReference=reference,
                                               Account=Account,
                                               NonBlocking='FALSE',
                                               Narrative=reason)
예제 #3
0
 def test_should_setup_provider_reference_text_if_set(self):
     self.setup_ok_response()
     yo = Yo("username", "password")
     mock = MagicMock()
     yo.client = mock
     ref = "some reference"
     reason = "for some reason"
     account = "+123"
     yo.withdraw_funds(200, account, reason, provider_reference_text=ref)
     yo.client.make_request.assert_called_with(self.get_method(),
                                               Amount=200,
                                               ProviderReferenceText=ref,
                                               Account=account,
                                               NonBlocking='FALSE',
                                               Narrative=reason)
예제 #4
0
 def test_withdraw_funds_requires_a_valid_account(self):
     self.setup_ok_response()
     with self.assertRaises(Exception):
         yo = Yo("username", "password")
         yo.withdraw_funds(200, "123", "for some reason")
예제 #5
0
 def test_withdraw_funds_requires_a_valid_account(self):
     self.setup_ok_response()
     with self.assertRaises(Exception):
         yo = Yo("username", "password")
         yo.withdraw_funds(200, "+123", "for some reason")