Package gchecky :: Package test :: Module controller
[hide private]
[frames] | no frames]

Source Code for Module gchecky.test.controller

 1  import unittest 
 2   
 3  import gchecky.controller as gcontroller 
 4   
5 -class ControllerTestCase(unittest.TestCase):
6 - def setUp(self):
7 GCHECKOUT_VENDOR_ID = '552688368931861' 8 GCHECKOUT_MERCHANT_KEY = 'fse2vefEHSu8lQ2g-o6kZQ' 9 self.controller = gcontroller.Controller(GCHECKOUT_VENDOR_ID, 10 GCHECKOUT_MERCHANT_KEY, 11 True)
12 - def testArchiving(self):
13 self.controller.unarchive_order('457164429557231') 14 self.controller.archive_order('457164429557231')
15 - def testMessaging(self):
16 self.controller.send_buyer_message('457164429557231', 'Test message.')
17 - def testMerchantOrderNumber(self):
18 self.controller.add_merchant_order_number('457164429557231', 'BLA123456-BLA')
19 - def testTrackingData(self):
20 self.controller.add_tracking_data('457164429557231', 21 'UPS', 22 'ARGHHH-UPS-NUMBER123456')
23 - def testChargeOrder(self):
24 self.controller.charge_order('920492774454564', 1599)
25 - def testRefundOrder(self):
26 self.controller.refund_order('457164429557231', 0.04, 27 'Test refunding mechanism', 'Oh la la!')
28 - def testAuthorizeOrder(self):
29 self.controller.authorize_order('457164429557231')
30 - def testCancelOrder(self):
31 self.controller.cancel_order('566018579274459', 32 'Test order cancelling', 'Oh al al!')
33 - def testProcessOrder(self):
34 self.controller.process_order('920492774454564')
35 - def testDeliverOrder(self):
36 self.controller.deliver_order('920492774454564', send_email=True)
37
38 -def controllerSuite():
39 suite = unittest.TestSuite() 40 # suite.addTest(ControllerTestCase('testArchiving')) 41 # suite.addTest(ControllerTestCase('testMessaging')) 42 # suite.addTest(ControllerTestCase('testMerchantOrderNumber')) 43 # suite.addTest(ControllerTestCase('testTrackingData')) 44 45 suite.addTest(ControllerTestCase('testChargeOrder')) 46 # suite.addTest(ControllerTestCase('testRefundOrder')) 47 48 # suite.addTest(ControllerTestCase('testAuthorizeOrder')) 49 # suite.addTest(ControllerTestCase('testCancelOrder')) 50 suite.addTest(ControllerTestCase('testProcessOrder')) 51 suite.addTest(ControllerTestCase('testDeliverOrder')) 52 return suite
53 54 if __name__ == '__main__': 55 unittest.main() 56