Skip to content

Commit

Permalink
Fix tests - port to URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Ihor Makhnyk committed Mar 22, 2024
1 parent 71f7ca1 commit 3cff989
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tests/OpenAITests/OpenAITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,14 @@ class OpenAITests: XCTestCase {
let configuration = OpenAI.Configuration(token: "foo", organizationIdentifier: "bar", timeoutInterval: 14)
let openAI = OpenAI(configuration: configuration, session: self.urlSession)
let chatsURL = openAI.buildURL(path: .chats)
XCTAssertEqual(chatsURL, URL(string: "https://api.openai.com/v1/chat/completions"))
XCTAssertEqual(chatsURL, URL(string: "https://api.openai.com:443/v1/chat/completions"))
}

func testCustomURLBuilt() {
let configuration = OpenAI.Configuration(token: "foo", organizationIdentifier: "bar", host: "my.host.com", timeoutInterval: 14)
let openAI = OpenAI(configuration: configuration, session: self.urlSession)
let chatsURL = openAI.buildURL(path: .chats)
XCTAssertEqual(chatsURL, URL(string: "https://my.host.com/v1/chat/completions"))
XCTAssertEqual(chatsURL, URL(string: "https://my.host.com:443/v1/chat/completions"))
}
}

Expand Down

0 comments on commit 3cff989

Please sign in to comment.