Skip to content

Commit

Permalink
fix(maiia): Fix test_maiia
Browse files Browse the repository at this point in the history
  • Loading branch information
NamPNQ committed Oct 25, 2022
1 parent 2a828c8 commit 54ac318
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_maiia.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import pytest
import logging
from urllib.parse import parse_qs
from scraper.pattern.center_info import CenterInfo
from utils.vmd_utils import DummyQueue
import httpx
Expand All @@ -25,6 +26,11 @@

def app(request: httpx.Request) -> httpx.Response:
try:
qs = parse_qs(
request.url._uri_reference.query
) # we dont access request.url.query because its return query.encode('ascii'), will crashed
if int(qs.get("page", ["0"])[0]) >= 1:
return httpx.Response(200, json={"items": [], "total": 0})
slug = request.url.path.split("/")[-1]
endpoint = slug.split("?")[0]
path = Path("tests", "fixtures", "maiia", f"{endpoint}.json")
Expand Down Expand Up @@ -128,7 +134,9 @@ def test_get_first_availability():
assert first_availability.isoformat() == "2021-05-13T13:40:00+00:00"


@pytest.mark.skip(reason="je n'ai aucune connaissance de ce scrapper et je dois supprimer les artifacts qui encombrent gitlab :D")
@pytest.mark.skip(
reason="je n'ai aucune connaissance de ce scrapper et je dois supprimer les artifacts qui encombrent gitlab :D"
)
def test_fetch_slots():

# Oops I forgot centerid
Expand Down

0 comments on commit 54ac318

Please sign in to comment.