-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_get_by_code.py
More file actions
36 lines (25 loc) · 1.18 KB
/
test_get_by_code.py
File metadata and controls
36 lines (25 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Copyright (c) MultiSafepay, Inc. All rights reserved.
# This file is licensed under the Open Software License (OSL) version 3.0.
# For a copy of the license, see the LICENSE.txt file in the project root.
# See the DISCLAIMER.md file for disclaimer details.
"""Test module for e2e testing."""
import pytest
from multisafepay.api.base.response.custom_api_response import (
CustomApiResponse,
)
from multisafepay.api.paths.gateways.gateway_manager import GatewayManager
from multisafepay.api.paths.gateways.response.gateway import Gateway
from multisafepay.sdk import Sdk
@pytest.fixture(scope="module")
def gateway_manager(e2e_sdk: Sdk) -> GatewayManager:
"""Fixture that provides a GatewayManager instance for testing."""
return e2e_sdk.get_gateway_manager()
def test_get_by_code(gateway_manager: GatewayManager):
"""
Test the get_by_code method of the GatewayManager.
This test checks if the gateway is retrieved successfully and is of the correct type.
"""
get_by_code_response = gateway_manager.get_by_code("IDEAL")
assert isinstance(get_by_code_response, CustomApiResponse)
gateway = get_by_code_response.get_data()
assert isinstance(gateway, Gateway)