# Path: pynubank/exception.py
# class NuException(Exception):
# 
#     def __init__(self, message):
#         super().__init__(message)
# 
# Path: pynubank/utils/graphql.py
# def prepare_request_body(graphql_object, variables=None):
#     if variables is None:
#         variables = {}
# 
#     return OrderedDict({
#         'variables': variables,
#         'query': _get_query(graphql_object)
#     })
# 
# Path: pynubank/utils/http.py
# class HttpClient:
# 
#     def __init__(self):
#         self._cert = None
#         self._headers = {
#             'Content-Type': 'application/json',
#             'X-Correlation-Id': 'WEB-APP.pewW9',
#             'User-Agent': 'pynubank Client - https://github.com/andreroggeri/pynubank',
#         }
# 
#     def set_cert(self, cert_path: str):
#         self._cert = cert_path
# 
#     def set_header(self, name: str, value: str):
#         self._headers[name] = value
# 
#     def remove_header(self, name: str):
#         self._headers.pop(name)
# 
#     def get_header(self, name: str):
#         return self._headers.get(name)
# 
#     @property
#     def _cert_args(self):
#         return {'pkcs12_filename': self._cert, 'pkcs12_password': ''} if self._cert else {}
# 
#     def _handle_response(self, response: Response) -> dict:
#         if response.status_code != 200:
#             raise NuRequestException(response)
# 
#         return response.json()
# 
#     def raw_get(self, url: str) -> Response:
#         return get(url, headers=self._headers, **self._cert_args)
# 
#     def get(self, url: str) -> dict:
#         return self._handle_response(self.raw_get(url))
# 
#     def post(self, url: str, json: dict) -> dict:
#         return self._handle_response(post(url, json=json, headers=self._headers, **self._cert_args))


import fnmatch
import json
from pathlib import Path
from pynubank import NuException
from pynubank.utils.graphql import prepare_request_body
from pynubank.utils.http import HttpClient
        self._results[('https://mocked-proxy-url/api/proxy/bills_summary_123', '')] = self._read_data('bills_summary')
        self._results[(GHOSTFLAME_URL, str(prepare_request_body('account_id')))] = self._read_data('boleto_create')
        self._results[(GHOSTFLAME_URL, str(prepare_request_body('create_boleto')))] = self._read_data('boleto_create')
        self._results[('https://*/api/discovery', '')] = self._read_data('discovery_api')
        self._results[('https://*/api/app/discovery', '')] = self._read_data('discovery_app')
        self._results[('https://mocked-proxy-url/api/token', '')] = self._read_data('discovery_login')
        self._results[('https://mocked-proxy-url/api/proxy/login', '')] = self._read_data('discovery_login')
        self._results[('https://mocked-proxy-url/api/proxy/lift', '')] = self._read_data('discovery_login')
        self._results[('https://mocked-proxy-url/api/proxy/events_123', '')] = self._read_data('proxy_events')
        self._results[(GHOSTFLAME_URL, str(prepare_request_body('create_money_request')))] = self._read_data('money')
        self._results[('https://mocked-proxy-url/api/proxy/customer_123', '')] = self._read_data('customer')
        self._results[(GHOSTFLAME_URL, str(prepare_request_body('get_pix_keys')))] = self._read_data('pix_keys')
        self._results[(GHOSTFLAME_URL, str(prepare_request_body('create_pix_money_request')))] = self._read_data(
            'pix_money_request')
        self._results[('https://mocked-proxy-url/api/proxy/revoke_token_123', '')] = {}

        self._results[(GHOSTFLAME_URL, str(prepare_request_body('create_pix_money_request')))] = self._read_data(
            'pix_money_request')
        self._results[GHOSTFLAME_URL, str(prepare_request_body('pix_receipt_screen'))] = self._read_data(
            'pix_receipt_screen')

    def add_mock_url(self, url: str, graphql_object: str, response_json_name: str):
        self._results[(url, graphql_object)] = self._read_data(response_json_name)

    def remove_mock_url(self, route: tuple):
        del self._results[route]

    def get(self, url: str) -> dict:
        result = self._find(url)
        if result is None:

# Path: pynubank/exception.py
# class NuException(Exception):
# 
#     def __init__(self, message):
#         super().__init__(message)
# 
# Path: pynubank/utils/graphql.py
# def prepare_request_body(graphql_object, variables=None):
#     if variables is None:
#         variables = {}
# 
#     return OrderedDict({
#         'variables': variables,
#         'query': _get_query(graphql_object)
#     })
# 
# Path: pynubank/utils/http.py
# class HttpClient:
# 
#     def __init__(self):
#         self._cert = None
#         self._headers = {
#             'Content-Type': 'application/json',
#             'X-Correlation-Id': 'WEB-APP.pewW9',
#             'User-Agent': 'pynubank Client - https://github.com/andreroggeri/pynubank',
#         }
# 
#     def set_cert(self, cert_path: str):
#         self._cert = cert_path
# 
#     def set_header(self, name: str, value: str):
#         self._headers[name] = value
# 
#     def remove_header(self, name: str):
#         self._headers.pop(name)
# 
#     def get_header(self, name: str):
#         return self._headers.get(name)
# 
#     @property
#     def _cert_args(self):
#         return {'pkcs12_filename': self._cert, 'pkcs12_password': ''} if self._cert else {}
# 
#     def _handle_response(self, response: Response) -> dict:
#         if response.status_code != 200:
#             raise NuRequestException(response)
# 
#         return response.json()
# 
#     def raw_get(self, url: str) -> Response:
#         return get(url, headers=self._headers, **self._cert_args)
# 
#     def get(self, url: str) -> dict:
#         return self._handle_response(self.raw_get(url))
# 
#     def post(self, url: str, json: dict) -> dict:
#         return self._handle_response(post(url, json=json, headers=self._headers, **self._cert_args))


# Path: pynubank/utils/mock_http.py
import fnmatch
import json
from pathlib import Path
from pynubank import NuException
from pynubank.utils.graphql import prepare_request_body
from pynubank.utils.http import HttpClient

        self._results[('https://mocked-proxy-url/api/proxy/bills_summary_123', '')] = self._read_data('bills_summary')
        self._results[(GHOSTFLAME_URL, str(prepare_request_body('account_id')))] = self._read_data('boleto_create')
        self._results[(GHOSTFLAME_URL, str(prepare_request_body('create_boleto')))] = self._read_data('boleto_create')
        self._results[('https://*/api/discovery', '')] = self._read_data('discovery_api')
        self._results[('https://*/api/app/discovery', '')] = self._read_data('discovery_app')
        self._results[('https://mocked-proxy-url/api/token', '')] = self._read_data('discovery_login')
        self._results[('https://mocked-proxy-url/api/proxy/login', '')] = self._read_data('discovery_login')
        self._results[('https://mocked-proxy-url/api/proxy/lift', '')] = self._read_data('discovery_login')
        self._results[('https://mocked-proxy-url/api/proxy/events_123', '')] = self._read_data('proxy_events')
        self._results[(GHOSTFLAME_URL, str(prepare_request_body('create_money_request')))] = self._read_data('money')
        self._results[('https://mocked-proxy-url/api/proxy/customer_123', '')] = self._read_data('customer')
        self._results[(GHOSTFLAME_URL, str(prepare_request_body('get_pix_keys')))] = self._read_data('pix_keys')
        self._results[(GHOSTFLAME_URL, str(prepare_request_body('create_pix_money_request')))] = self._read_data(
            'pix_money_request')
        self._results[('https://mocked-proxy-url/api/proxy/revoke_token_123', '')] = {}

        self._results[(GHOSTFLAME_URL, str(prepare_request_body('create_pix_money_request')))] = self._read_data(
            'pix_money_request')
        self._results[GHOSTFLAME_URL, str(prepare_request_body('pix_receipt_screen'))] = self._read_data(
            'pix_receipt_screen')

    def add_mock_url(self, url: str, graphql_object: str, response_json_name: str):
        self._results[(url, graphql_object)] = self._read_data(response_json_name)

    def remove_mock_url(self, route: tuple):
        del self._results[route]

    def get(self, url: str) -> dict:
        result = self._find(url)
        if result is None:

            raise NuException(f'There is no result expected for {url}')