This directory contains test files and HTTP fixtures for mocking API responses.
The subdirectories (e.g., search_bart/, feeds_gtfs/, etc.) contain HTTP response fixtures recorded by httptest2.
These fixtures are not committed to the repository because:
When you run tests with an API key set, httptest2 automatically records API responses:
# Set your API key
mobdb::mobdb_set_key("your-refresh-token")
# Run tests - fixtures will be recorded automatically
devtools::test()
Fixtures are stored in subdirectories like:
- search_bart/api.mobilitydatabase.org/v1/search-xxxxx.json
- feeds_gtfs/api.mobilitydatabase.org/v1/gtfs_feeds-xxxxx.json
- etc.
If you don't have fixtures recorded:
Option 1: Record them (recommended)
mobdb::mobdb_set_key("your-token")
devtools::test() # Will record and pass
Option 2: Skip HTTP tests Tests will automatically skip if: - httptest2 is not installed - API key is not configured - Required fixtures don't exist
For continuous integration:
Current approach: Option B - Tests skip gracefully without fixtures.
Typical sizes when recorded: - Feed listings: 12-48KB - Single feed: 4-8KB - Datasets: 4-8KB - Search results: 700-800KB (contains full feed metadata for all matches) - Tokens: 4KB (but contains sensitive JWTs)
Total: ~3-4MB if all fixtures recorded
The .R files in this directory are actual test files:
- test-api-feeds.R - Feed discovery and filtering
- test-datasets.R - Historical datasets
- test-search.R - Full-text search
- test-helpers.R - Utility functions
- test-integration.R - Download/read integration
- test-auth.R - Authentication
These ARE committed to the repository.
The .gitignore in this directory excludes all subdirectories (fixtures) but keeps test files:
# Ignore all fixture directories
*/
This means only *.R files and this README are tracked by git.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.