fix:feature-parity
This commit is contained in:
1 parent
6c0a6eb498
commit
c33d87b06e
8 files changed
+196
-33
No files matched your search
@@ -23,4 +23,38 @@ final class TranscriptionClientTests: XCTestCase {
|
||||
XCTAssertNil(TranscriptionClient.endpointURL(from: ""))
|
||||
XCTAssertNil(TranscriptionClient.endpointURL(from: "example.com"))
|
||||
}
|
||||
|
||||
func testHostedFirstPlanFallsBackToLocal() {
|
||||
let plan = TranscriptionPlan(
|
||||
hosted: endpoint("Hosted", "https://hosted.example.com"),
|
||||
local: endpoint("Local", "http://localhost:8080"),
|
||||
hostedFirst: true
|
||||
)
|
||||
|
||||
XCTAssertEqual(plan.endpoints.map(\.label), ["Hosted", "Local"])
|
||||
}
|
||||
|
||||
func testDisabledHostedFirstUsesOnlyLocal() {
|
||||
let plan = TranscriptionPlan(
|
||||
hosted: endpoint("Hosted", "https://hosted.example.com"),
|
||||
local: endpoint("Local", "http://localhost:8080"),
|
||||
hostedFirst: false
|
||||
)
|
||||
|
||||
XCTAssertEqual(plan.endpoints.map(\.label), ["Local"])
|
||||
}
|
||||
|
||||
func testPlanSkipsEmptyEndpoints() {
|
||||
let plan = TranscriptionPlan(
|
||||
hosted: endpoint("Hosted", ""),
|
||||
local: endpoint("Local", ""),
|
||||
hostedFirst: true
|
||||
)
|
||||
|
||||
XCTAssertTrue(plan.endpoints.isEmpty)
|
||||
}
|
||||
|
||||
private func endpoint(_ label: String, _ value: String) -> TranscriptionEndpoint {
|
||||
TranscriptionEndpoint(label: label, endpoint: value, model: "", key: "")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user