Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ extend-safe-fixes = [
"D415", # docstrings should end with a period, question mark, or exclamation point
]
ignore = [
"D103",
"D104",
"D107",
"D200",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

@pytest.fixture(scope="module")
def auth_manager() -> AuthManager:
"""Fixture that provides an AuthManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

@pytest.fixture(scope="module")
def sdk() -> Sdk:
"""Fixture that provides an SDK instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
return Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

@pytest.fixture(scope="module")
def category_manager() -> "CategoryManager":
"""Fixture that provides a CategoryManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

@pytest.fixture(scope="module")
def gateway_manager() -> GatewayManager:
"""Fixture that provides a GatewayManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

@pytest.fixture(scope="module")
def gateway_manager() -> GatewayManager:
"""Fixture that provides a GatewayManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

@pytest.fixture(scope="module")
def issuer_manager() -> IssuerManager:
"""Fixture that provides an IssuerManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
1 change: 1 addition & 0 deletions tests/multisafepay/e2e/examples/me_manager/test_get_me.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

@pytest.fixture(scope="module")
def me_manager() -> "MeManager":
"""Fixture that provides a MeManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

@pytest.fixture(scope="module")
def order_manager() -> OrderManager:
"""Fixture that provides an OrderManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

@pytest.fixture(scope="module")
def order_manager() -> "OrderManager":
"""Fixture that provides an OrderManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

@pytest.fixture(scope="module")
def order_manager() -> OrderManager:
"""Fixture that provides an OrderManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

@pytest.fixture(scope="module")
def order_manager() -> OrderManager:
"""Fixture that provides an OrderManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

@pytest.fixture(scope="module")
def order_manager() -> OrderManager:
"""Fixture that provides an OrderManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

@pytest.fixture(scope="module")
def order_manager() -> OrderManager:
"""Fixture that provides an OrderManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

@pytest.fixture(scope="module")
def order_manager() -> OrderManager:
"""Fixture that provides an OrderManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

@pytest.fixture(scope="module")
def payment_method_manager() -> PaymentMethodManager:
"""Fixture that provides a PaymentMethodManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

@pytest.fixture(scope="module")
def payment_method_manager():
"""Fixture that provides a PaymentMethodManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

@pytest.fixture(scope="module")
def sdk() -> Sdk:
"""Fixture that provides an SDK instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
return Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

@pytest.fixture(scope="module")
def transaction_manager():
"""Fixture that provides a TransactionManager instance for testing."""
load_dotenv()
api_key = os.getenv("API_KEY")
multisafepay_sdk = Sdk(api_key, False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@


def test_afterpay_response():
"""Test AfterPay order response parsing and validation."""
data = {
"amount": 37485,
"amount_refunded": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@


def test_initializes_payment_options_correctly():
"""Test that PaymentOptions initializes correctly with all parameters."""
payment_options = PaymentOptions(
notification_url="https://example.com/notify",
settings={"key": "value"},
Expand All @@ -33,6 +34,7 @@ def test_initializes_payment_options_correctly():


def test_initializes_payment_options_with_empty_values():
"""Test that PaymentOptions initializes with None values when no parameters are provided."""
payment_options = PaymentOptions()

assert payment_options.notification_url is None
Expand All @@ -44,6 +46,7 @@ def test_initializes_payment_options_with_empty_values():


def test_add_notification_url_updates_value():
"""Test that add_notification_url updates the notification_url value."""
payment_options = PaymentOptions()
payment_options_updated = payment_options.add_notification_url(
"https://example.com/notify",
Expand All @@ -54,6 +57,7 @@ def test_add_notification_url_updates_value():


def test_add_settings_updates_value():
"""Test that add_settings updates the settings value."""
payment_options = PaymentOptions()
payment_options_updated = payment_options.add_settings({"key": "value"})

Expand All @@ -62,6 +66,7 @@ def test_add_settings_updates_value():


def test_add_notification_method_updates_value():
"""Test that add_notification_method updates the notification_method value."""
payment_options = PaymentOptions()
payment_options_updated = payment_options.add_notification_method("GET")

Expand All @@ -70,6 +75,7 @@ def test_add_notification_method_updates_value():


def test_add_notification_method_raises_exception_for_invalid_value():
"""Test that add_notification_method raises exception for invalid values."""
payment_options = PaymentOptions()

try:
Expand All @@ -79,6 +85,7 @@ def test_add_notification_method_raises_exception_for_invalid_value():


def test_add_redirect_url_updates_value():
"""Test that add_redirect_url updates the redirect_url value."""
payment_options = PaymentOptions()
payment_options_updated = payment_options.add_redirect_url(
"https://example.com/redirect",
Expand All @@ -89,6 +96,7 @@ def test_add_redirect_url_updates_value():


def test_add_cancel_url_updates_value():
"""Test that add_cancel_url updates the cancel_url value."""
payment_options = PaymentOptions()
payment_options_updated = payment_options.add_cancel_url(
"https://example.com/cancel",
Expand All @@ -99,6 +107,7 @@ def test_add_cancel_url_updates_value():


def test_add_close_window_updates_value():
"""Test that add_close_window updates the close_window value."""
payment_options = PaymentOptions()
payment_options_updated = payment_options.add_close_window(True)

Expand Down