mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-30 22:25:19 +00:00 
			
		
		
		
	[ie/youtube] Add a PO Token Provider Framework (#12840)
https://github.com/yt-dlp/yt-dlp/tree/master/yt_dlp/extractor/youtube/pot/README.md Authored by: coletdjnz
This commit is contained in:
		| @@ -1435,6 +1435,27 @@ class TestYoutubeDL(unittest.TestCase): | ||||
|         FakeYDL().close() | ||||
|         assert all_plugins_loaded.value | ||||
| 
 | ||||
|     def test_close_hooks(self): | ||||
|         # Should call all registered close hooks on close | ||||
|         close_hook_called = False | ||||
|         close_hook_two_called = False | ||||
| 
 | ||||
|         def close_hook(): | ||||
|             nonlocal close_hook_called | ||||
|             close_hook_called = True | ||||
| 
 | ||||
|         def close_hook_two(): | ||||
|             nonlocal close_hook_two_called | ||||
|             close_hook_two_called = True | ||||
| 
 | ||||
|         ydl = FakeYDL() | ||||
|         ydl.add_close_hook(close_hook) | ||||
|         ydl.add_close_hook(close_hook_two) | ||||
| 
 | ||||
|         ydl.close() | ||||
|         self.assertTrue(close_hook_called, 'Close hook was not called') | ||||
|         self.assertTrue(close_hook_two_called, 'Close hook two was not called') | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|     unittest.main() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 coletdjnz
					coletdjnz