def test_authorize_transaction_void(self): self.client._transaction.void.return_value = TRANSACTION_RESULT transaction = AuthorizeTransaction(self.client, '123') result = transaction.void() self.assertEqual(self.client._transaction.void.call_args, (('123', ), {})) self.assertTrue(isinstance(result, AuthorizeTransaction)) self.assertEqual(result.uid, '2171062816')
def test_authorize_transaction_void(self): self.client._transaction.void.return_value = TRANSACTION_RESULT transaction = AuthorizeTransaction(self.client, '123') result = transaction.void() self.assertEqual(self.client._transaction.void.call_args, (('123',), {})) self.assertTrue(isinstance(result, AuthorizeTransaction)) self.assertEqual(result.uid, '2171062816')
def test_authorize_transaction_credit(self): self.client._transaction.credit.return_value = TRANSACTION_RESULT transaction = AuthorizeTransaction(self.client, '123') # Test with amount result = transaction.credit('1111', 10) self.assertEqual(self.client._transaction.credit.call_args, (('1111', '123', 10), {})) self.assertTrue(isinstance(result, AuthorizeTransaction)) self.assertEqual(result.uid, '2171062816')
def test_authorize_transaction_settle(self): self.client._transaction.settle.return_value = TRANSACTION_RESULT transaction = AuthorizeTransaction(self.client, '123') # Test without amount result = transaction.settle() self.assertEqual(self.client._transaction.settle.call_args, (('123',), {'amount': None})) self.assertTrue(isinstance(result, AuthorizeTransaction)) self.assertEqual(result.uid, '2171062816') # Test with amount result = transaction.settle(10) self.assertEqual(self.client._transaction.settle.call_args, (('123',), {'amount': 10})) self.assertTrue(isinstance(result, AuthorizeTransaction)) self.assertEqual(result.uid, '2171062816')
def test_authorize_transaction_basic(self): transaction = AuthorizeTransaction(self.client, '123') repr(transaction)