Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusts credential tests #75

Merged
merged 5 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ jobs:
- name: Test with unittest
run: |
python -m unittest discover tests/
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
5 changes: 2 additions & 3 deletions tests/test_advanced_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
datetime,
timedelta,
)
import os
import unittest
import uuid

import mercadopago


class TestAdvancedPayment(unittest.TestCase):
"""
Test Module: Advanced Payment
"""
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

@unittest.skip(reason="Outdated API usage")
def test_all(self):
Expand Down
10 changes: 3 additions & 7 deletions tests/test_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Module: test_card
"""
from datetime import datetime
import os
import random
import unittest

import mercadopago


Expand All @@ -14,13 +14,11 @@ class TestCard(unittest.TestCase):
"""

_customer_id = None
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

@classmethod
def setUpClass(cls):
customer_data = cls.create_customer()
print(customer_data)
cls._customer_id = customer_data["response"]["id"]

@classmethod
Expand All @@ -46,7 +44,6 @@ def test_all(self):
}

card_token_created = self.sdk.card_token().create(card_token_object)
print(card_token_created)

card_object = {
"customer_id": self._customer_id,
Expand All @@ -58,8 +55,7 @@ def test_all(self):
self.assertEqual(self.sdk.card().get(
self._customer_id, card_created["response"]["id"])["status"], 200)

self.sdk.card().delete(self._customer_id,
card_created["response"]["id"])
self.sdk.card().delete(self._customer_id, card_created["response"]["id"])

@classmethod
def create_customer(cls):
Expand Down
5 changes: 2 additions & 3 deletions tests/test_card_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
Module: test_card_token
"""
from datetime import datetime
import os
import unittest

import mercadopago


class TestCardToken(unittest.TestCase):
"""
Test Module: Card Token
"""
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_all(self):
"""
Expand Down
5 changes: 2 additions & 3 deletions tests/test_chargeback.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
"""
Module: test_chargeback
"""
import os
import unittest

import mercadopago


class TestChargeback(unittest.TestCase):
"""
Test Module: Chargeback
"""
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_search_chargeback(self):
"""
Expand Down
11 changes: 4 additions & 7 deletions tests/test_customer.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
"""
Module: test_customer
"""
import os
import random
import unittest

import mercadopago


class TestCustomer(unittest.TestCase):
"""
Test Module: Customer
"""
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_all(self):
"""
Expand Down Expand Up @@ -41,12 +40,10 @@ def test_all(self):
customer_saved["response"]["id"], {"last_name": "Payer"})
self.assertEqual(200, customer_update["status"])

customer_updated = self.sdk.customer().get(
customer_saved["response"]["id"])
customer_updated = self.sdk.customer().get(customer_saved["response"]["id"])
self.assertEqual(customer_updated["response"]["last_name"], "Payer")

customer_deleted = self.sdk.customer().delete(
customer_saved["response"]["id"])
customer_deleted = self.sdk.customer().delete(customer_saved["response"]["id"])
self.assertEqual(200, customer_deleted["status"])


Expand Down
5 changes: 2 additions & 3 deletions tests/test_identification_type.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
"""
Module: test_identification_type
"""
import os
import unittest

import mercadopago


class TestIdentificationType(unittest.TestCase):
"""
Test Module: Identification Type
"""
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_find_all(self):
"""
Expand Down
5 changes: 2 additions & 3 deletions tests/test_merchant_order.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
"""
Module: test_merchant_order
"""
import os
import unittest
import uuid

import mercadopago


class TestMerchantOrder(unittest.TestCase):
"""
Test Module: Merchant Order
"""
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_all(self):
"""
Expand Down
5 changes: 2 additions & 3 deletions tests/test_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
Module: test_payment
"""
from datetime import datetime
import os
import unittest

import mercadopago


class TestPayment(unittest.TestCase):
"""
Test Module: Payment
"""
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_create_and_find(self):
"""
Expand Down
5 changes: 2 additions & 3 deletions tests/test_payment_methods.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
"""
Module: test_payment_methods
"""
import os
import unittest

import mercadopago


class TestPaymentMethods(unittest.TestCase):
"""
Test Module: Payment Methods
"""
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_find(self):
"""
Expand Down
5 changes: 2 additions & 3 deletions tests/test_plan.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Module: test_plan
"""
import os
import unittest

import random
import mercadopago

Expand All @@ -12,8 +12,7 @@ class TestPlan(unittest.TestCase):
Test Module: Preference
"""

sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_all(self):
"""
Expand Down
5 changes: 2 additions & 3 deletions tests/test_preapproval.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
"""
Module: test_preapproval
"""
import os
import unittest

import mercadopago


class TestPreApproval(unittest.TestCase):
"""
Test Module: PreApproval
"""
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_create(self):
"""
Expand Down
5 changes: 2 additions & 3 deletions tests/test_preference.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Module: test_preference
"""
import os
import unittest

import time
import mercadopago

Expand All @@ -11,8 +11,7 @@ class TestPreference(unittest.TestCase):
"""
Test Module: Preference
"""
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_all(self):
"""
Expand Down
5 changes: 2 additions & 3 deletions tests/test_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Module: test_plan
"""
from datetime import datetime
import os
import unittest

import random
import mercadopago

Expand All @@ -15,8 +15,7 @@ class TestSubscription(unittest.TestCase):
_customer_id = None
_customer_email = None
_plan_id = None
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

@classmethod
def setUpClass(cls):
Expand Down
5 changes: 2 additions & 3 deletions tests/test_user.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"""
Module: test_user
"""
import os
import unittest

import mercadopago


class TestUser(unittest.TestCase):
sdk = mercadopago.SDK(
"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966")
sdk = mercadopago.SDK(os.environ['ACCESS_TOKEN'])

def test_find_user(self):
self.assertEqual(self.sdk.user().get()["status"], 200)
Expand Down
Loading