Skip to content

Commit

Permalink
✅ Fix unit tests
Browse files Browse the repository at this point in the history
- disable rgpd test outside of europe/france
  • Loading branch information
essembeh committed Oct 9, 2024
1 parent c18fb40 commit c4bd837
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_youtube.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from http.cookiejar import CookieJar

import pytest
from httpx import AsyncClient
from httpx import AsyncClient, get

from yourss.youtube import (
YoutubeMetadata,
Expand All @@ -11,6 +11,12 @@
from yourss.youtube.utils import html_get_rgpd_forms


def is_rgpd_applicable():
resp = get("https://ifconfig.io/country_code")
return resp.status_code == 200 and resp.text.strip() == "FR"


@pytest.mark.skipif(not is_rgpd_applicable(), reason="Not applicable outside Europe")
@pytest.mark.asyncio(loop_scope="module")
async def test_rgpd_with_cookies():
api = YoutubeWebApi(AsyncClient(cookies=CookieJar()))
Expand Down

0 comments on commit c4bd837

Please sign in to comment.