import pandas as pd from queries.process_ciq_4g import generate_ciq_4g_sheet def _sample_ciq_4g_df() -> pd.DataFrame: return pd.DataFrame( [ { "eNodeBName": "0273_TBC_DIRE-HAMDALLAYE_4G", "CellName": "0273_TBC_DIRE-HAMDALLAYE_1_L700", "DlEarfcn": 9410, "eNodeB Id": 273, "Local Cell ID": 1, "TAC": 101, "Physical cell ID": 11, "Root sequence index": 101, }, { "eNodeBName": "0273_TBC_DIRE-HAMDALLAYE_4G", "CellName": "0273_TBC_DIRE-HAMDALLAYE_1_L800", "DlEarfcn": 6300, "eNodeB Id": 273, "Local Cell ID": 2, "TAC": 101, "Physical cell ID": 12, "Root sequence index": 102, }, { "eNodeBName": "0660_SKS_HAMADALLAYE_4G", "CellName": "0660_SKS_HAMADALLAYE_1_L700", "DlEarfcn": 9410, "eNodeB Id": 660, "Local Cell ID": 1, "TAC": 202, "Physical cell ID": 21, "Root sequence index": 201, }, { "eNodeBName": "0660_SKS_HAMADALLAYE_4G", "CellName": "0660_SKS_HAMADALLAYE_1_L800", "DlEarfcn": 6300, "eNodeB Id": 660, "Local Cell ID": 2, "TAC": 202, "Physical cell ID": 22, "Root sequence index": 202, }, ] ) def test_generate_ciq_4g_sheet_uses_profile_specific_bands_in_config_and_site_name(): df = generate_ciq_4g_sheet( _sample_ciq_4g_df(), year_suffix="26", bands="G9G18U9U21L8L18L26", mcc=610, mnc=2, profile_definitions={ "densif": "G9G18U9U21L7L8L18L26", "rural": "G9U9L7L8", }, site_profile_mapping={"273": "densif", "660": "rural"}, ).sort_values(by="Unique Site ID", kind="stable").reset_index(drop=True) assert list(df["Config"]) == ["G9G18U9U21L7L8L18L26", "G9U9L7L8"] assert list(df["Site Name"]) == [ "0273_TBC_DIRE-HAMDALLAYE_26_G9G18U9U21L7L8L18L26_NA", "0660_SKS_HAMADALLAYE_26_G9U9L7L8_NA", ] assert list(df["$lnbtsid"]) == [273, 660]