Marc Kupietz | 5d9e3a2 | 2020-03-23 09:03:29 +0100 | [diff] [blame] | 1 | library("testthat") |
| 2 | library("RKorAPClient") |
| 3 | |
Marc Kupietz | bd9796f | 2025-06-26 15:40:08 +0200 | [diff] [blame^] | 4 | # Set up keyring for testing to avoid interactive password prompts |
| 5 | if (requireNamespace("keyring", quietly = TRUE)) { |
| 6 | # Use environment backend for testing to avoid password prompts |
| 7 | if (!nzchar(Sys.getenv("KEYRING_BACKEND"))) { |
| 8 | Sys.setenv("KEYRING_BACKEND" = "env") |
| 9 | } |
| 10 | # Set empty password for file backend if needed |
| 11 | if (!nzchar(Sys.getenv("KEYRING_PASS"))) { |
| 12 | Sys.setenv("KEYRING_PASS" = "") |
| 13 | } |
| 14 | } |
| 15 | |
Marc Kupietz | 5d9e3a2 | 2020-03-23 09:03:29 +0100 | [diff] [blame] | 16 | test_check("RKorAPClient") |