import unittest
from tests.testbase import TestBase
from mangopaysdk.entities.refund import Refund


class TestRefunds(TestBase):
    """
    Tests basic methods for refunds
    """
    
    def test_Refund_GetForTransfer(self):
        transfer = self.getJohnsTransfer()
        refund = self.getJohnsRefundForTransfer(transfer)        
        user = self.getJohn()        
        getRefund = self.sdk.refunds.Get(refund.Id)
        self.assertEqual(getRefund.Id, refund.Id)
        self.assertEqual(getRefund.InitialTransactionId, transfer.Id)
        self.assertEqual(getRefund.AuthorId, user.Id)
        self.assertEqual(getRefund.Type, 'TRANSFER')
    
    def test_Refund_GetForPayIn(self):
        pass
        #refund = self.getJohnsRefundForPayIn()
        #payIn = self.getJohnsPayInCardDirect()
        #user = self.getJohn()
        #getRefund = self.sdk.refunds.Get(refund.Id)
        #self.assertEqual(getRefund.Id, refund.Id)
        #self.assertEqual(getRefund.InitialTransactionId, payIn.Id)
        #self.assertEqual(getRefund.AuthorId, user.Id)
        #self.assertEqual(getRefund.Type, 'PAYOUT')

@@ -706,26 +706,11 @@
   pa
-ss%0A        #refund
+yIn
  = s
@@ -725,22 +725,23 @@
 ohns
-RefundForPayIn
+PayInCardDirect
 ()%0A 
@@ -751,14 +751,14 @@
     
-#payIn
+refund
  = s
@@ -769,32 +769,36 @@
 getJohns
-PayInCardDirect(
+RefundForPayIn(payIn
 )%0A      
@@ -799,17 +799,16 @@
         
-#
 user = s
@@ -829,17 +829,16 @@
         
-#
 getRefun
@@ -873,33 +873,32 @@
 und.Id)%0A        
-#
 self.assertEqual
@@ -923,33 +923,32 @@
 und.Id)%0A        
-#
 self.assertEqual
@@ -990,33 +990,32 @@
 yIn.Id)%0A        
-#
 self.assertEqual
@@ -1056,9 +1056,8 @@
     
-#
 self

fix Refund_GetForPayIn test