Exemplo n.º 1
0
 def test_refund_transaction_fail(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     with self.assertRaises(PygarmeTransactionApiError):
         transaction.refund()
Exemplo n.º 2
0
 def test_get_transaction_by_id_fails(self):
     transaction = Transaction(api_key='apikey')
     with self.assertRaises(PygarmeTransactionApiError):
         transaction.find_by_id(314)
Exemplo n.º 3
0
 def test_refund_transaction(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     transaction.refund()
     self.assertEqual('refunded', transaction.status)
Exemplo n.º 4
0
 def test_get_transaction_by_id(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     self.assertEqual(314, transaction.id)
Exemplo n.º 5
0
 def test_get_transaction_by_id_with_invalid_id(self):
     transaction = Transaction(api_key='apikey')
     with self.assertRaises(ValueError):
         transaction.find_by_id('foo bar')
Exemplo n.º 6
0
 def test_refund_transaction_fail(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     with self.assertRaises(PygarmeTransactionApiError):
         transaction.refund()
Exemplo n.º 7
0
 def test_refund_transaction(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     transaction.refund()
     self.assertEqual('refunded', transaction.status)
Exemplo n.º 8
0
 def test_get_transaction_by_id_fails(self):
     transaction = Transaction(api_key='apikey')
     with self.assertRaises(PygarmeTransactionApiError):
         transaction.find_by_id(314)
Exemplo n.º 9
0
 def test_get_transaction_by_id_with_invalid_id(self):
     transaction = Transaction(api_key='apikey')
     with self.assertRaises(ValueError):
         transaction.find_by_id('foo bar')
Exemplo n.º 10
0
 def test_get_transaction_by_id(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     self.assertEqual(314, transaction.id)