Пример #1
0
 def test_refund_transaction_fail(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     with self.assertRaises(PygarmeTransactionApiError):
         transaction.refund()
Пример #2
0
 def test_get_transaction_by_id_fails(self):
     transaction = Transaction(api_key='apikey')
     with self.assertRaises(PygarmeTransactionApiError):
         transaction.find_by_id(314)
Пример #3
0
 def test_refund_transaction(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     transaction.refund()
     self.assertEqual('refunded', transaction.status)
Пример #4
0
 def test_get_transaction_by_id(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     self.assertEqual(314, transaction.id)
Пример #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')
Пример #6
0
 def test_refund_transaction_fail(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     with self.assertRaises(PygarmeTransactionApiError):
         transaction.refund()
Пример #7
0
 def test_refund_transaction(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     transaction.refund()
     self.assertEqual('refunded', transaction.status)
Пример #8
0
 def test_get_transaction_by_id_fails(self):
     transaction = Transaction(api_key='apikey')
     with self.assertRaises(PygarmeTransactionApiError):
         transaction.find_by_id(314)
Пример #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')
Пример #10
0
 def test_get_transaction_by_id(self):
     transaction = Transaction(api_key='apikey')
     transaction.find_by_id(314)
     self.assertEqual(314, transaction.id)