def test_track_request_sends_data_to_influxdb_for_tracked_uris(  # type: ignore[no-untyped-def]
    mocker: MockerFixture,
    expected_resource: str,
):
    """
    Verify that the correct number of calls are made to InfluxDB for the various uris.
    """
    # Given
    mock_influxdb = mocker.patch("app_analytics.track.InfluxDBWrapper")
    mock_environment = mocker.MagicMock()

    # When
    track_request_influxdb(
        resource=Resource.get_from_name(expected_resource),
        host="testserver",
        environment=mock_environment,
    )

    # Then
    mock_influxdb.return_value.add_data_point.assert_called_once()
    assert (
        mock_influxdb.return_value.add_data_point.call_args_list[0][1]["tags"][
            "resource"
        ]
        == expected_resource
    )

    Verify that the correct number of calls are made to InfluxDB for the various uris.
    
api/tests/unit/app_analytics/test_unit_app_analytics_track.py