mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-07 19:08:30 +03:00
generic_extractor download tests adaptations
This commit is contained in:
@@ -7,4 +7,7 @@ LINKEDIN_TEST_USERNAME=""
|
|||||||
LINKEDIN_TEST_PASSWORD=""
|
LINKEDIN_TEST_PASSWORD=""
|
||||||
|
|
||||||
# twitter test credentials
|
# twitter test credentials
|
||||||
TWITTER_BEARER_TOKEN="TEST_KEY"
|
TWITTER_BEARER_TOKEN="TEST_KEY"
|
||||||
|
|
||||||
|
# some geo/VPN IPs are blocked by truth social, disable if you have issues
|
||||||
|
TEST_TRUTH_SOCIAL="true"
|
||||||
@@ -10,6 +10,7 @@ from auto_archiver.modules.generic_extractor.generic_extractor import GenericExt
|
|||||||
from .test_extractor_base import TestExtractorBase
|
from .test_extractor_base import TestExtractorBase
|
||||||
|
|
||||||
CI = os.getenv("GITHUB_ACTIONS", "") == "true"
|
CI = os.getenv("GITHUB_ACTIONS", "") == "true"
|
||||||
|
TEST_TRUTH_SOCIAL = os.getenv("TEST_TRUTH_SOCIAL", "") == "true"
|
||||||
|
|
||||||
|
|
||||||
class TestGenericExtractor(TestExtractorBase):
|
class TestGenericExtractor(TestExtractorBase):
|
||||||
@@ -149,6 +150,7 @@ class TestGenericExtractor(TestExtractorBase):
|
|||||||
result = self.extractor.download(item)
|
result = self.extractor.download(item)
|
||||||
assert result is not False
|
assert result is not False
|
||||||
|
|
||||||
|
@pytest.mark.skipif(not TEST_TRUTH_SOCIAL, reason="Truth social download tests disabled in environment variables.")
|
||||||
@pytest.mark.skipif(CI, reason="Truth social blocks GH actions.")
|
@pytest.mark.skipif(CI, reason="Truth social blocks GH actions.")
|
||||||
@pytest.mark.download
|
@pytest.mark.download
|
||||||
def test_truthsocial_download_video(self, make_item):
|
def test_truthsocial_download_video(self, make_item):
|
||||||
@@ -157,6 +159,7 @@ class TestGenericExtractor(TestExtractorBase):
|
|||||||
assert len(result.media) == 1
|
assert len(result.media) == 1
|
||||||
assert result is not False
|
assert result is not False
|
||||||
|
|
||||||
|
@pytest.mark.skipif(not TEST_TRUTH_SOCIAL, reason="Truth social download tests disabled in environment variables.")
|
||||||
@pytest.mark.skipif(CI, reason="Truth social blocks GH actions.")
|
@pytest.mark.skipif(CI, reason="Truth social blocks GH actions.")
|
||||||
@pytest.mark.download
|
@pytest.mark.download
|
||||||
def test_truthsocial_download_no_media(self, make_item):
|
def test_truthsocial_download_no_media(self, make_item):
|
||||||
@@ -164,6 +167,7 @@ class TestGenericExtractor(TestExtractorBase):
|
|||||||
result = self.extractor.download(item)
|
result = self.extractor.download(item)
|
||||||
assert result is not False
|
assert result is not False
|
||||||
|
|
||||||
|
@pytest.mark.skipif(not TEST_TRUTH_SOCIAL, reason="Truth social download tests disabled in environment variables.")
|
||||||
@pytest.mark.skipif(CI, reason="Truth social blocks GH actions.")
|
@pytest.mark.skipif(CI, reason="Truth social blocks GH actions.")
|
||||||
@pytest.mark.download
|
@pytest.mark.download
|
||||||
def test_truthsocial_download_poll(self, make_item):
|
def test_truthsocial_download_poll(self, make_item):
|
||||||
@@ -171,6 +175,7 @@ class TestGenericExtractor(TestExtractorBase):
|
|||||||
result = self.extractor.download(item)
|
result = self.extractor.download(item)
|
||||||
assert result is not False
|
assert result is not False
|
||||||
|
|
||||||
|
@pytest.mark.skipif(not TEST_TRUTH_SOCIAL, reason="Truth social download tests disabled in environment variables.")
|
||||||
@pytest.mark.skipif(CI, reason="Truth social blocks GH actions.")
|
@pytest.mark.skipif(CI, reason="Truth social blocks GH actions.")
|
||||||
@pytest.mark.download
|
@pytest.mark.download
|
||||||
def test_truthsocial_download_single_image(self, make_item):
|
def test_truthsocial_download_single_image(self, make_item):
|
||||||
@@ -179,6 +184,7 @@ class TestGenericExtractor(TestExtractorBase):
|
|||||||
assert len(result.media) == 1
|
assert len(result.media) == 1
|
||||||
assert result is not False
|
assert result is not False
|
||||||
|
|
||||||
|
@pytest.mark.skipif(not TEST_TRUTH_SOCIAL, reason="Truth social download tests disabled in environment variables.")
|
||||||
@pytest.mark.skipif(CI, reason="Truth social blocks GH actions.")
|
@pytest.mark.skipif(CI, reason="Truth social blocks GH actions.")
|
||||||
@pytest.mark.download
|
@pytest.mark.download
|
||||||
def test_truthsocial_download_multiple_images(self, make_item):
|
def test_truthsocial_download_multiple_images(self, make_item):
|
||||||
@@ -276,6 +282,7 @@ class TestGenericExtractor(TestExtractorBase):
|
|||||||
|
|
||||||
assert "Bellingchat Premium is with Kolina Koltai" in post.get_title()
|
assert "Bellingchat Premium is with Kolina Koltai" in post.get_title()
|
||||||
|
|
||||||
|
@pytest.mark.skip(reason="Newer yt-dlp versions don't support image download.")
|
||||||
@pytest.mark.download
|
@pytest.mark.download
|
||||||
def test_download_facebook_image(self, make_item):
|
def test_download_facebook_image(self, make_item):
|
||||||
post = self.extractor.download(
|
post = self.extractor.download(
|
||||||
|
|||||||
Reference in New Issue
Block a user