Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

radvis_bw: new abstellanlagen_ort BILDUNGSEINRICHTUNG #157

Open
the-infinity opened this issue Oct 29, 2024 · 3 comments
Open

radvis_bw: new abstellanlagen_ort BILDUNGSEINRICHTUNG #157

the-infinity opened this issue Oct 29, 2024 · 3 comments

Comments

@the-infinity
Copy link
Contributor

abstellanlagen_ort seems to have a new enum value, BILDUNGSEINRICHTUNG. This should be supported at ParkAPI Sources.

@the-infinity the-infinity changed the title radvis: new abstellanlagen_ort BILDUNGSEINRICHTUNG radvis_bw: new abstellanlagen_ort BILDUNGSEINRICHTUNG Oct 29, 2024
@AbdullahiFatola
Copy link
Collaborator

AbdullahiFatola commented Nov 18, 2024

I have created PR for this.

@the-infinity I also noticed the list variable sources_to_ignore in the current converter.py is empty, and defined as environment variable in order to avoid duplicate parking sites. When I leave it empty, I get AssertionError below and doesn't pass the GitHub lint test.

Now I have added "MOBIDATABW" to the empty variable sources_to_ignore in the PR and the AssertionError is gone...Is that okay?

=================================== FAILURES ===================================
_____________ RadvisBwConverterTest.test_get_static_parking_sites ______________

radvis_bw_pull_converter = <parkapi_sources.converters.radvis_bw.converter.RadvisBwPullConverter object at 0x7f4c5b6c3790>
requests_mock = <requests_mock.mocker.Mocker object at 0x7f4c5b305570>

    @staticmethod
    def test_get_static_parking_sites(radvis_bw_pull_converter: RadvisBwPullConverter, requests_mock: Mocker):
        json_path = Path(Path(__file__).parent, 'data', 'radvis_bw.json')
        with json_path.open() as json_file:
            json_data = json_file.read()
    
        requests_mock.get(
            'https://radvis.landbw.de/api/geoserver/basicauth/radvis/wfs?service=WFS&version=2.0.0&request=GetFeature'
            '&typeNames=radvis%3Aabstellanlage&outputFormat=application/json',
            text=json_data,
        )
        static_parking_site_inputs, import_parking_site_exceptions = radvis_bw_pull_converter.get_static_parking_sites()
    
>       assert len(static_parking_site_inputs) == 690
E       AssertionError: assert 3034 == 690
E        +  where 3034 = len([StaticParkingSiteInput(uid='15176[65](https://github.com/ParkenDD/parkapi-sources-v3/actions/runs/11890892696/job/33130492627#step:6:66)02', name='Abstellanlage', group_uid='151766502', purpose=<PurposeType.BIKE: 'BIKE...ty_truck=UnsetValue, capacity_bus=UnsetValue, opening_hours=UnsetValue, external_identifiers=UnsetValue, tags=[]), ...])

tests/converters/radvis_bw_test.py:45: AssertionError
=========================== short test summary info ============================
FAILED tests/converters/radvis_bw_test.py::RadvisBwConverterTest::test_get_static_parking_sites - AssertionError: assert 3034 == 690
 +  where 3034 = len([StaticParkingSiteInput(uid='1517[66](https://github.com/ParkenDD/parkapi-sources-v3/actions/runs/11890892696/job/33130492627#step:6:67)502', name='Abstellanlage', group_uid='151766502', purpose=<PurposeType.BIKE: 'BIKE...ty_truck=UnsetValue, capacity_bus=UnsetValue, opening_hours=UnsetValue, external_identifiers=UnsetValue, tags=[]), ...])

@the-infinity
Copy link
Contributor Author

Please do not hardode such values. There are two approaches to resolves this:

  1. set the PARK_API_RADVIS_IGNORE_SOURCES in your mocked test
  2. change the number of results in the tests, which would be reasonable as you also updated the test data

@AbdullahiFatola
Copy link
Collaborator

Thanks for the Tips, It has now been updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants