Only return success for instagram_tbot_extractor.py with content.

This commit is contained in:
erinhmclark
2025-03-31 14:14:36 +01:00
parent c7c7eb00a1
commit 144adaad5b
2 changed files with 11 additions and 2 deletions

View File

@@ -68,6 +68,12 @@ def test_download_invalid(extractor, metadata_sample, mocker):
assert extractor.download(metadata_sample) is False
def test_fails_with_empty_response(extractor, metadata_sample, mocker):
mocker.patch.object(extractor, "_send_url_to_bot", return_value=(mocker.MagicMock(), 101))
mocker.patch.object(extractor, "_process_messages", return_value="")
assert extractor.download(metadata_sample) is False
@pytest.mark.skip(reason="Requires authentication.")
class TestInstagramTbotExtractorReal(TestExtractorBase):
# To run these tests set the TELEGRAM_API_ID and TELEGRAM_API_HASH environment variables, and ensure the session file exists.