@@ -136,25 +136,33 @@ def test_select_ids_to_keep_realistic(mock_website_config, mock_permissions):
136136 pytest .skip ("Fixture DB not found" )
137137
138138 test_cache = DriveCache (fixture_db )
139-
140- # IDs from the user's tricky case
141- # 17VpttQypHvoBExKbm9AX48iGFnmORgkX is in "Unread"
142- # 1i4O9RG7ug2WWNpMN44qj-P1m2tfzoUBP is in "Early Indian Schools of Buddhism"
143-
139+
144140 with mock .patch ('gdrive.gcache' , test_cache ):
141+ # 17VpttQypHvoBExKbm9AX48iGFnmORgkX is in "Unread"
142+ # 1i4O9RG7ug2WWNpMN44qj-P1m2tfzoUBP is in "Early Indian Schools of Buddhism"
145143 file1 = test_cache .get_item ('17VpttQypHvoBExKbm9AX48iGFnmORgkX' )
146144 file2 = test_cache .get_item ('1i4O9RG7ug2WWNpMN44qj-P1m2tfzoUBP' )
147-
148145 assert file1 is not None
149146 assert file2 is not None
150-
151147 files = [file1 , file2 ]
152- folder_slugs = {}
148+ folder_slugs = gdrive . load_folder_slugs () # in a realistic test, load the actual folder slugs
153149
154150 ids , reason = gdrive .select_ids_to_keep (files , folder_slugs )
155-
156151 assert ids == ['1i4O9RG7ug2WWNpMN44qj-P1m2tfzoUBP' ]
157- assert reason == gdrive .IDSelectionReason .GENERIC_SUBFOLDER
152+ assert reason == gdrive .IDSelectionReason .TAG_FOLDER
153+
154+ # 1bCq5KZ2UQGt81N2qWBvr8sx7WnO_k-HS is in "Unread (Sangha)"
155+ # 17Ky1unlqJA_IkdL0Hzqxo_l9gPxjnar- is in "Buddhism"
156+ file1 = test_cache .get_item ('1bCq5KZ2UQGt81N2qWBvr8sx7WnO_k-HS' )
157+ file2 = test_cache .get_item ('17Ky1unlqJA_IkdL0Hzqxo_l9gPxjnar-' )
158+
159+ assert file1 is not None
160+ assert file2 is not None
161+ files = [file1 , file2 ]
162+
163+ ids , reason = gdrive .select_ids_to_keep (files , folder_slugs )
164+ assert ids == ['17Ky1unlqJA_IkdL0Hzqxo_l9gPxjnar-' ]
165+ assert reason == gdrive .IDSelectionReason .TAG_FOLDER
158166
159167def test_select_ids_to_keep_name_length (mock_website_config , mock_permissions ):
160168 files = [
0 commit comments