#!/usr/bin/env python
"""Tests for `chemdatareader` package."""
# pylint: disable=redefined-outer-name
from chemdatareader import __version__
from chemdatareader.chemdatareader_interface import ChemDatReaderInterface
from chemdatareader.chemdatareader_impl import ChemDatReader
from chemdatareader.chemdatacollector_builder_interface import ChemDatCollectorBuilderInterface, ChemDataCollectorInterface
from chemdatareader.collectors.pubchem_collector import PubChemServiceBuilder, PubChemCollector


# def test_version():
#     """Sample pytest test function."""
#     assert __version__ == "0.0.1"

def test_ChemDataReaderInterface():
    """ testing the formal interface (ChemDataReaderInterface)
    """
    assert issubclass(ChemDatReader, ChemDatReaderInterface)
    

def test_ChemDataCollectorBuilderInterface():
    """ testing the formal interface (PubChemReaderInterface)
    """
    assert issubclass(PubChemServiceBuilder, ChemDatCollectorBuilderInterface)


def test_ChemDataCollectorInterface():
    """ testing the formal interface (PubChemReaderInterface)
    """
    assert issubclass(PubChemCollector, ChemDataCollectorInterface)

def test_PubChemReader():
    """ Testing PubChemService class
    """
    pchr = PubChemCollector()
    
    assert pchr.test_connection() == "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/"

