27 lines
721 B
Swift
27 lines
721 B
Swift
import XCTest
|
|
|
|
@testable import Transui
|
|
|
|
final class TranscriptionClientTests: XCTestCase {
|
|
func testAddsTranscriptionPath() {
|
|
XCTAssertEqual(
|
|
TranscriptionClient.endpointURL(from: "https://example.com/")?.absoluteString,
|
|
"https://example.com/v1/audio/transcriptions"
|
|
)
|
|
}
|
|
|
|
func testKeepsFullTranscriptionPath() {
|
|
XCTAssertEqual(
|
|
TranscriptionClient.endpointURL(
|
|
from: "https://example.com/v1/audio/transcriptions"
|
|
)?.absoluteString,
|
|
"https://example.com/v1/audio/transcriptions"
|
|
)
|
|
}
|
|
|
|
func testRejectsInvalidEndpoint() {
|
|
XCTAssertNil(TranscriptionClient.endpointURL(from: ""))
|
|
XCTAssertNil(TranscriptionClient.endpointURL(from: "example.com"))
|
|
}
|
|
}
|