mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Comprehensive rename of all openclaw references to hanzo-bot equivalents: - Package: openclaw → @hanzo/bot - Binary: openclaw → hanzo-bot - Types: OpenClaw* → Bot* - Env vars: OPENCLAW_* → BOT_* - Android: ai.openclaw.android → ai.hanzo.bot.android - iOS/macOS: ai.openclaw.* → ai.hanzo.* - Swift modules: OpenClaw* → Bot* - Plugins: openclaw.plugin.json → bot.plugin.json - Paths: .openclaw/ → .hanzo/bot/ - URLs: github.com/openclaw → github.com/hanzoai
39 lines
1.5 KiB
Swift
39 lines
1.5 KiB
Swift
import BotIPC
|
|
import CoreLocation
|
|
import Testing
|
|
@testable import HanzoBot
|
|
|
|
@Suite(.serialized)
|
|
@MainActor
|
|
struct PermissionManagerTests {
|
|
@Test func voiceWakePermissionHelpersMatchStatus() async {
|
|
let direct = PermissionManager.voiceWakePermissionsGranted()
|
|
let ensured = await PermissionManager.ensureVoiceWakePermissions(interactive: false)
|
|
#expect(ensured == direct)
|
|
}
|
|
|
|
@Test func statusCanQueryNonInteractiveCaps() async {
|
|
let caps: [Capability] = [.microphone, .speechRecognition, .screenRecording]
|
|
let status = await PermissionManager.status(caps)
|
|
#expect(status.keys.count == caps.count)
|
|
}
|
|
|
|
@Test func ensureNonInteractiveDoesNotThrow() async {
|
|
let caps: [Capability] = [.microphone, .speechRecognition, .screenRecording]
|
|
let ensured = await PermissionManager.ensure(caps, interactive: false)
|
|
#expect(ensured.keys.count == caps.count)
|
|
}
|
|
|
|
@Test func locationStatusMatchesAuthorizationAlways() async {
|
|
let status = CLLocationManager().authorizationStatus
|
|
let results = await PermissionManager.status([.location])
|
|
#expect(results[.location] == (status == .authorizedAlways))
|
|
}
|
|
|
|
@Test func ensureLocationNonInteractiveMatchesAuthorizationAlways() async {
|
|
let status = CLLocationManager().authorizationStatus
|
|
let ensured = await PermissionManager.ensure([.location], interactive: false)
|
|
#expect(ensured[.location] == (status == .authorizedAlways))
|
|
}
|
|
}
|