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

Feature/mobility data importers tests use mock fixtures #298

Closed

Conversation

juuso-j
Copy link

@juuso-j juuso-j commented Jul 26, 2023

Mobility data importers tests use mock fixtures

Trello #446


Breakdown:

Importers

  1. mobility_data/importers/bicycle_stands.py
    • Add function for getting data source, Replace BaseImportCommand with BaseCommand and remove obsolete code
  2. mobility_data/importers/bike_service_stations.py
    • Add function for getting the data layer, Replace BaseImportCommand with BaseCommand and remove obsolete code
  3. mobility_data/importers/loading_unloading_places.py
  4. mobility_data/importers/share_car_parking_places.py
    • Move geojson file name retrieving to a function, Replace BaseImportCommand with BaseCommand and remove obsolete code
  5. mobility_data/importers/lounaistieto_shapefiles.py
    • Fix typo
  6. mobility_data/importers/charging_stations.py, Replace BaseImportCommand with BaseCommand and remove obsolete code
    • Move geojson CSV file name retrieving to a function
  7. mobility_data/importers/wfs.py
    • Catch GDAL exception, add function to get the data source, Send max_features as arg to get_data_source function
  8. mobility_data/management/commands/import_disabled_and_no_staff_parkings.py
    • Replace BaseImportCommand with BaseCommand and remove obsolete code
  9. mobility_data/importers/disabled_and_no_staff_parking.py
    • Move geojson file name retrieving to a function
  10. mobility_data/importers/gas_filling_station.py
    • Remove json_data param
  11. smbackend_turku/importers/bicycle_stands.py
  12. smbackend_turku/importers/bike_service_stations.py
  13. smbackend_turku/importers/stations.py
    • Remove test_data param

Management command

  1. mobility_data/management/commands/import_lounaistieto_shapefiles.py
  2. mobility_data/management/commands/import_marinas.py
  3. mobility_data/management/commands/import_outdoor_gym_devices.py
    • Replace inheritance from BaseImportCommand with BaseCommand
  4. mobility_data/management/commands/import_foli_parkandride_stops.py
  5. mobility_data/management/commands/import_under_and_overpasses.py
  6. mobility_data/management/commands/import_parking_machines.py
    • Fix typo

Tests

  1. mobility_data/tests/test_import_accessories.py
  2. mobility_data/tests/test_import_bicycle_stands.py
  3. mobility_data/tests/test_import_bike_service_stations.py
  4. mobility_data/tests/test_import_charging_stations.py
  5. mobility_data/tests/test_import_disabled_and_no_staff_parkings.py
  6. mobility_data/tests/test_import_gas_filling_stations.py
  7. mobility_data/tests/test_import_loading_and_unloading_places.py
  8. mobility_data/tests/test_import_payment_zones.py
  9. mobility_data/tests/test_import_scooter_restrictions.py
  10. mobility_data/tests/test_import_share_car_parking_places.py
  11. smbackend_turku/tests/test_bike_service_stations.py
  12. smbackend_turku/tests/test_charging_stations.py
  13. smbackend_turku/tests/test_gas_filling_stations.py
    • Use mock objects for fixture data

Other

  1. mobility_data/management/commands/_utils.py
    • Remove empty file, functionality moved
  2. mobility_data/management/commands/delete_deprecated_units.py
    • Remove obsolete 'the'
  3. mobility_data/tests/utils.py
    • Add get_data_source and get_test_fixture_data_layer functions

@juuso-j juuso-j added the enhancement New feature or request label Jul 26, 2023
@juuso-j juuso-j requested a review from ezkat July 26, 2023 12:26
@juuso-j juuso-j self-assigned this Jul 26, 2023
Insead of importing and using fetch json use this, this solves the problem that
the return value of fetch json is not mocked in tests.
@juuso-j juuso-j closed this Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant