Beispiel #1
0
    def test_put_method_called(self):

        httpretty.register_uri(
            httpretty.PUT,
            self.endpoint_url("/customer/4013"),
            content_type='text/json',
            body='{"status": true, "contributors": null}',
            status=302,
        )

        req = PayStackRequests()
        response = req.put('customer/4013', data={'test': 'requests'})
        self.assertTrue(response['status'])
Beispiel #2
0
    def test_get_method_called(self):

        httpretty.register_uri(
            httpretty.GET,
            self.endpoint_url("/transaction/4013"),
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        req = PayStackRequests()
        response = req.get('transaction/4013', )
        self.assertTrue(response['status'])
    def test_get_method_called(self):

        httpretty.register_uri(
            httpretty.GET,
            "https://api.paystack.co/transaction/4013",
            content_type='text/json',
            body='{"status": true, "contributors": true}',
            status=201,
        )

        req = PayStackRequests()
        response = req.get('transaction/4013',)
        self.assertTrue(response['status'])
Beispiel #4
0
    def test_post_method_called(self):

        httpretty.register_uri(
            httpretty.POST,
            self.endpoint_url("/transaction/charge_token"),
            content_type='text/json',
            body='{"status": true, "contributors": null}',
            status=302,
        )

        req = PayStackRequests()
        response = req.post('transaction/charge_token',
                            data={'track': 'requests'})
        self.assertTrue(response['status'])
    def test_put_method_called(self):

        httpretty.register_uri(
            httpretty.PUT,
            "https://api.paystack.co/customer/4013",
            content_type='text/json',
            body='{"status": true, "contributors": null}',
            status=302,
        )

        req = PayStackRequests()
        response = req.put('customer/4013',
                           data={'test': 'requests'})
        self.assertTrue(response['status'])
    def test_post_method_called(self):

        httpretty.register_uri(
            httpretty.POST,
            "https://api.paystack.co/transaction/charge_token",
            content_type='text/json',
            body='{"status": true, "contributors": null}',
            status=302,
        )

        req = PayStackRequests()
        response = req.post('transaction/charge_token',
                            data={'track': 'requests'})
        self.assertTrue(response['status'])