'''
Integration Test to check for Mongo DB connectivity
'''

import pytest, os
from dotenv import load_dotenv, find_dotenv
from todo_app.trello_api_calls import establish_mongo_connection

def test_establish_mongo_connection():
    file_path = find_dotenv('.env')
    load_dotenv(file_path, override = True)
    output_collection_name = establish_mongo_connection(
        'TEST_DATABASE', 'TEST_COLLECTION')
    print('Collection name is ==>', output_collection_name.name)
    print('Database name is ==>', output_collection_name.database.name)
    assert output_collection_name.name == os.environ.get('TEST_COLLECTION')
    assert output_collection_name.database.name == os.environ.get(
        'TEST_DATABASE'
    )