## test ProphetPrerocess class ##
# The class is composed by the methods tested in test_datapreparation_utils.py 
# So, we just check if the output of the preprocessing can be the input for a prophet model


import prophet
import pytest
import pandas as pd

from test_tc.datapreparation.model_preproc import ProphetPreprocess


## test get_hierarchical_df ##
def sample_data_hier():
    # Sample data for testing
    data = {
        "date_col": pd.date_range("2023-07-01", periods=5, freq="D"),
        "zone": ["North", "North", "South", "South", "West"],
        "city": ["Milan", "Turin", "Rome", "Naples", "Florence"]
    }
    return pd.DataFrame(data)

import warnings
def test_ProphetPreprocess_df():
    with warnings.catch_warnings():
        warnings.simplefilter("ignore")
        hierarchy = {
            "level1": "zone",
            "level2": "city"
        }
        time_granularity = "D"
        date_col = "date_col"
        missing_data_strategy = ''

        # Sample data for testing
        df = sample_data_hier()

        prophet_preproc = ProphetPreprocess(hierarchy, time_granularity, date_col, missing_data_strategy)

        X, S, tags = prophet_preproc.transform(df)
        
        # Check if X is ready to be used for Prophet
        Prophet = prophet.Prophet()
        Prophet.fit(X)





