File tree Expand file tree Collapse file tree
Tests/PodiumRequestsClientTests/Requests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ //
2+ // RequestsClientWeatherTests.swift
3+ // PodiumRequestsClient
4+ //
5+ // Created by Mathis Le Bonniec on 12/21/25.
6+ //
7+
8+ import PodiumRequestsClient
9+ import Testing
10+
11+ @Suite ( . tags( . weather) )
12+ struct RequestsClientWeatherTests {
13+ let sessionKey : Int = 9094
14+ let client : RequestsClient = RequestsClient (
15+ baseURL: " https://api.podium.mathislebonniec.fr/v1/formula1 " ,
16+ apiKey: " 08fe5ccd-8d72-49e0-ae2b-3f097f2b96a1 "
17+ )
18+
19+ @Test
20+ func getAllWeather( ) async throws {
21+ let weatherUpdates = try await client. getAllWeatherUpdates ( sessionKey: sessionKey)
22+
23+ #expect( weatherUpdates. count == 176 )
24+ }
25+
26+ @Test
27+ func getOneWeather( ) async throws {
28+ let weatherUpdates = try await client. getAllWeatherUpdates ( sessionKey: sessionKey)
29+ let first = try #require( weatherUpdates. first ( where: { $0. pressure == 1013.7 } ) )
30+
31+ #expect( first. humidity == 39 )
32+ #expect( first. pressure == 1013.7 )
33+ #expect( first. temperature. track == 47.4 )
34+ #expect( first. temperature. air == 25.8 )
35+ #expect( first. wind. direction == 149 )
36+ #expect( first. wind. speed == 1 )
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments