# Path: bottery/messenger/api.py
# class MessengerAPI:
#     url = 'https://graph.facebook.com/{0}{1}?access_token={2}'
# 
#     def __init__(self, token, session, version='v2.6'):
#         self.token = token
#         self.session = session
#         self.version = version
# 
#     def make_url(self, method):
#         return self.url.format(self.version, method, self.token)
# 
#     async def messages(self, user_id, text, type='RESPONSE'):
#         request = {
#             'messaging_type': type,
#             'recipient': {
#                 'id': user_id,
#             },
#             'message': {
#                 'text': text,
#             },
#         }
#         url = self.make_url('/me/messages')
#         return await self.session.post(url, json=request)


import pytest
from bottery.messenger import MessengerAPI
from utils import AsyncMock



@pytest.fixture
def api():
    session = AsyncMock()
    return MessengerAPI('token', session)


def test_make_url_default_version():

# Path: bottery/messenger/api.py
# class MessengerAPI:
#     url = 'https://graph.facebook.com/{0}{1}?access_token={2}'
# 
#     def __init__(self, token, session, version='v2.6'):
#         self.token = token
#         self.session = session
#         self.version = version
# 
#     def make_url(self, method):
#         return self.url.format(self.version, method, self.token)
# 
#     async def messages(self, user_id, text, type='RESPONSE'):
#         request = {
#             'messaging_type': type,
#             'recipient': {
#                 'id': user_id,
#             },
#             'message': {
#                 'text': text,
#             },
#         }
#         url = self.make_url('/me/messages')
#         return await self.session.post(url, json=request)


# Path: tests/platform/messenger/test_api.py
import pytest
from bottery.messenger import MessengerAPI
from utils import AsyncMock




@pytest.fixture
def api():
    session = AsyncMock()
    return MessengerAPI('token', session)


def test_make_url_default_version():

    api = MessengerAPI('token', 'session')