| from queries.process_ue_capability import parse_uecap_text |
|
|
|
|
| CA_TEXT = """ |
| 08:33:50.000 LTE RRC Signaling |
| { |
| ueCapabilityInformation |
| { |
| ueCapabilityInformation-r8 |
| { |
| uE-EUTRA-Capability |
| { |
| UE-EUTRA-Capability |
| { |
| accessStratumRelease |
| { |
| rel15 |
| } |
| nonCriticalExtension |
| { |
| rf-Parameters-v1020 |
| { |
| supportedBandCombination-r10 |
| { |
| BandCombinationParameters-r10 #1 |
| { |
| BandParameters-r10 #1 |
| { |
| bandEUTRA-r10 |
| { |
| 3 |
| } |
| bandParametersDL-r10 |
| { |
| CA-MIMO-ParametersDL-r10 #1 |
| { |
| ca-BandwidthClassDL-r10 |
| { |
| a |
| } |
| } |
| } |
| } |
| BandParameters-r10 #2 |
| { |
| bandEUTRA-r10 |
| { |
| 7 |
| } |
| bandParametersDL-r10 |
| { |
| CA-MIMO-ParametersDL-r10 #1 |
| { |
| ca-BandwidthClassDL-r10 |
| { |
| c |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| """ |
|
|
|
|
| def test_ca_assessment_normalizes_combo_string() -> None: |
| sheets = parse_uecap_text(CA_TEXT, source_name="ca_sample.txt") |
| assert not sheets["CA_Assessment"].empty |
|
|
| row = sheets["CA_Assessment"].iloc[0].to_dict() |
| assert row["combo_norm"] == "B3A+B7C" |
| assert row["combo_type"] == "LTE CA" |
| assert row["consistency_status"] in {"valid", "partially_valid"} |
|
|
|
|
| def test_benchmark_diff_sheet_is_generated_when_reference_is_provided() -> None: |
| sheets = parse_uecap_text( |
| CA_TEXT, |
| source_name="ca_sample.txt", |
| benchmark_combos=["B7C+B3A", "B1A+B3A"], |
| ) |
| assert not sheets["Benchmark_CA_Diff"].empty |
| statuses = set(sheets["Benchmark_CA_Diff"]["status"].unique().tolist()) |
| assert "exact_match" in statuses |
| assert "missing_in_log" in statuses |
| assert "missing_in_benchmark" not in statuses |
|
|
|
|
| CA_TEXT_WITH_EMPTY_COMBO = """ |
| 08:33:50.000 LTE RRC Signaling |
| { |
| ueCapabilityInformation |
| { |
| ueCapabilityInformation-r8 |
| { |
| uE-EUTRA-Capability |
| { |
| UE-EUTRA-Capability |
| { |
| accessStratumRelease |
| { |
| rel15 |
| } |
| nonCriticalExtension |
| { |
| rf-Parameters-v1020 |
| { |
| supportedBandCombination-r10 |
| { |
| BandCombinationParameters-r10 #1 |
| { |
| BandParameters-r10 #1 |
| { |
| bandEUTRA-r10 |
| { |
| 3 |
| } |
| bandParametersDL-r10 |
| { |
| CA-MIMO-ParametersDL-r10 #1 |
| { |
| ca-BandwidthClassDL-r10 |
| { |
| a |
| } |
| } |
| } |
| } |
| } |
| BandCombinationParameters-r10 #2 |
| { |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| """ |
|
|
|
|
| def test_summary_normalized_count_excludes_empty_combo_norm() -> None: |
| sheets = parse_uecap_text(CA_TEXT_WITH_EMPTY_COMBO, source_name="ca_empty_combo.txt") |
| summary = sheets["Summary"].iloc[0].to_dict() |
| assert int(summary["ca_combo_normalized_count"]) == 1 |
|
|