Ejemplo n.º 1
0
class DataApiTests(unittest.TestCase):
    def setUp(self):
        super(DataApiTests, self).setUp()
        self.config = Config()
        self.dataApi = DataApi(self.config)

    def test_methods(self):
        self.assertEqual(self.dataApi.getPaymentMethods()[0].name, 'Platba kartou')

    def test_payment_statue(self):
        self.assertEqual(self.dataApi.getPaymentState(1), 2)

    def test_payment(self):
        self.assertEqual(self.dataApi.getPayment(1).id, '1')

    def test_payment_info(self):
        self.dataApi.getPaymentInstructions(1)

    def test_credentials(self):
        self.config.setCredentials(42, 43, 'test', 'test2')

        self.assertEqual(self.config.merchantId, 42)
        self.assertEqual(self.config.accountId, 43)
        self.assertEqual(self.config.password, 'test')
        self.assertEqual(self.config.dataApiPassword, 'test2')
Ejemplo n.º 2
0
class DataApiTests(unittest.TestCase):
    def setUp(self):
        super(DataApiTests, self).setUp()
        self.config = Config()
        self.dataApi = DataApi(self.config)

    def test_methods(self):
        self.assertEqual(self.dataApi.getPaymentMethods()[0].name,
                         'Platba kartou')

    def test_payment_state(self):
        self.assertEqual(self.dataApi.getPaymentState(1), 2)

    def test_payment(self):
        self.assertEqual(self.dataApi.getPayment(1).id, '1')

    def test_payment_info(self):
        self.dataApi.getPaymentInstructions(1)

    def test_payments(self):
        self.dataApi.getPayments(
            finished_on_from=datetime.datetime.now(UTC()) -
            datetime.timedelta(days=1))
        self.dataApi.getPayments(state_ids=[2])

    def test_credentials(self):
        self.config.setCredentials(42, 43, 'test', 'test2')

        self.assertEqual(self.config.merchantId, 42)
        self.assertEqual(self.config.accountId, 43)
        self.assertEqual(self.config.password, 'test')
        self.assertEqual(self.config.dataApiPassword, 'test2')
Ejemplo n.º 3
0
 def setUp(self):
     super(DataApiTests, self).setUp()
     self.config = Config()
     self.dataApi = DataApi(self.config)
Ejemplo n.º 4
0
 def setUp(self):
     super(DataApiTests, self).setUp()
     self.config = Config()
     self.dataApi = DataApi(self.config)
Ejemplo n.º 5
0
 def setUp(self):
     self.config = Config()
     self.gateApi = GateApi(self.config)
     self.dataApi = DataApi(self.config)