Ejemplo n.º 1
0
def test_center_info_fill():
    center = CenterInfo("Paris", "Centre 1", "https://.../centre")
    newloc = CenterLocation(1.122, 2.391, "Ok", "Cp")
    request = ScraperRequest(center.url, "2021-05-04")
    result = ScraperResult(request, "Doctolib", "2021-05-06")
    center.fill_localization(newloc)
    request.update_appointment_count(42)
    request.add_vaccine_type(Vaccine.PFIZER)
    request.add_vaccine_type(Vaccine.ASTRAZENECA)
    request.add_vaccine_type(Vaccine.MODERNA)
    request.update_internal_id("doctolibcentre1")
    request.update_practitioner_type(DRUG_STORE)
    request.set_appointments_only_by_phone(False)
    center.fill_result(result)

    assert center.location == newloc
    assert center.prochain_rdv == "2021-05-06"
    assert center.plateforme == "Doctolib"
    assert center.type == "drugstore"
    assert center.appointment_count == 42
    assert center.internal_id == "doctolibcentre1"
    assert center.vaccine_type == ["Pfizer-BioNTech", "AstraZeneca", "Moderna"]
    assert not center.appointment_by_phone_only
    assert center.default() == {
        "departement": "Paris",
        "nom": "Centre 1",
        "url": "https://.../centre",
        "location": {
            "longitude": 1.122,
            "latitude": 2.391,
            "city": "Ok",
            "cp": "Cp"
        },
        "metadata": None,
        "prochain_rdv": "2021-05-06",
        "plateforme": "Doctolib",
        "type": "drugstore",
        "appointment_count": 42,
        "internal_id": "doctolibcentre1",
        "vaccine_type": ["Pfizer-BioNTech", "AstraZeneca", "Moderna"],
        "appointment_by_phone_only": False,
        "erreur": None,
        "last_scan_with_availabilities": None,
        "appointment_schedules": None,
        "request_counts": None,
    }
Ejemplo n.º 2
0
def test_center_info_fill():
    center = CenterInfo("Paris", "Centre 1", "https://.../centre")
    newloc = CenterLocation(1.122, 2.391, "Ok")
    request = ScraperRequest(center.url, "2021-05-04")
    result = ScraperResult(request, "Doctolib", "2021-05-06")
    center.fill_localization(newloc)
    request.update_appointment_count(42)
    request.add_vaccine_type(Vaccine.PFIZER)
    request.add_vaccine_type(Vaccine.ASTRAZENECA)
    request.add_vaccine_type(Vaccine.MODERNA)
    request.update_internal_id("doctolibcentre1")
    request.update_practitioner_type(DRUG_STORE)
    request.set_appointments_only_by_phone(False)
    center.fill_result(result)

    assert center.location == newloc
    assert center.prochain_rdv == "2021-05-06"
    assert center.plateforme == "Doctolib"
    assert center.type == "drugstore"
    assert center.appointment_count == 42
    assert center.internal_id == "doctolibcentre1"
    assert center.vaccine_type == ["Pfizer-BioNTech", "AstraZeneca", "Moderna"]
    assert not center.appointment_by_phone_only
    assert center.default() == {
        'departement': 'Paris',
        'nom': 'Centre 1',
        'url': 'https://.../centre',
        'location': {
            'longitude': 1.122,
            'latitude': 2.391,
            'city': 'Ok'
        },
        'metadata': None,
        'prochain_rdv': '2021-05-06',
        'plateforme': 'Doctolib',
        'type': 'drugstore',
        'appointment_count': 42,
        'internal_id': 'doctolibcentre1',
        'vaccine_type': ['Pfizer-BioNTech', 'AstraZeneca', 'Moderna'],
        'appointment_by_phone_only': False,
        'erreur': None,
        'last_scan_with_availabilities': None,
        'appointment_schedules': None
    }