From 8a97a5c55844407db58b828f1abe2f306278e611 Mon Sep 17 00:00:00 2001 From: LeChatP Date: Mon, 23 Sep 2024 13:39:46 +0200 Subject: [PATCH] chore: Update TS_LOCATION path for test environment --- src/sr/timeout.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sr/timeout.rs b/src/sr/timeout.rs index ee4d805..6475a61 100644 --- a/src/sr/timeout.rs +++ b/src/sr/timeout.rs @@ -159,7 +159,10 @@ fn write_lockfile(lockfile_path: &Path) { .expect("Failed to write to lockfile"); } +#[cfg(not(test))] const TS_LOCATION: &str = "/var/run/rar/ts"; +#[cfg(test)] +const TS_LOCATION: &str = "target/ts"; fn read_cookies(user: &Cred) -> Result, Box> { let path = Path::new(TS_LOCATION).join(user.user.uid.as_raw().to_string());