@@ -24,7 +24,6 @@ def test_data_source_valid_type(self) -> None:
2424 assert data_source .type == "test"
2525
2626 def test_normalize_before_relocation_import (self ) -> None :
27- """Test that normalize_before_relocation_import correctly maps source_id"""
2827 monitor = self .create_monitor (project = self .project )
2928 data_source = self .create_data_source (
3029 type = DATA_SOURCE_CRON_MONITOR ,
@@ -63,16 +62,13 @@ def test_normalize_before_relocation_import(self) -> None:
6362 assert data_source .pk is None
6463
6564 def test_normalize_before_relocation_import_missing_source (self ) -> None :
66- """Test that normalize_before_relocation_import succeeds but doesn't update source_id if mapping not found"""
6765 monitor = self .create_monitor (project = self .project )
6866 data_source = self .create_data_source (
6967 type = DATA_SOURCE_CRON_MONITOR ,
7068 source_id = str (monitor .id ),
7169 organization_id = self .organization .id ,
7270 )
7371
74- old_source_id = data_source .source_id
75- old_data_source_id = data_source .id
7672 old_org_id = data_source .organization_id
7773
7874 # Create a PrimaryKeyMap without the monitor mapping
@@ -88,7 +84,5 @@ def test_normalize_before_relocation_import_missing_source(self) -> None:
8884 pk_map , ImportScope .Organization , ImportFlags ()
8985 )
9086
91- # Should succeed but leave source_id unchanged
92- assert result == old_data_source_id
93- assert data_source .source_id == old_source_id
94- assert data_source .pk is None
87+ # Should return None when the referenced source is not in pk_map
88+ assert result is None
0 commit comments