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)
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)
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)
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")
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")