Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/sysdiagnose/parsers/mobilebackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def __init__(self, config: SysdiagnoseConfig, case: dict) -> None:
def is_compatible(self) -> bool:
version_compatibility = super().is_compatible()
# not compatible with Apple TV
device_compatibility = "AppleTV" not in self.case_model and "Watch" not in self.case_model
# case_model is None when the case metadata carries no model; treat that as compatible
case_model = self.case_model or ""
device_compatibility = "AppleTV" not in case_model and "Watch" not in case_model
# both need to be compatible
return version_compatibility and device_compatibility

Expand Down
7 changes: 7 additions & 0 deletions tests/test_parsers_mobilebackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ def test_mobilebackup(self):
self.assert_has_required_fields_jsonl(item)
self.assert_result_summary_consistent(p, result)

def test_is_compatible_without_case_model(self):
"""A case whose metadata carries no "model" must not crash is_compatible()."""
case = {"case_id": "mobilebackup-no-model", "ios_version": "16.0"}
p = MobileBackupParser(self.sd.config, case=case)
self.assertIsNone(p.case_model)
self.assertIsInstance(p.is_compatible(), bool)


if __name__ == "__main__":
unittest.main()
Loading