()
| 99 | |
| 100 | impl Fs { |
| 101 | pub fn new() -> Self { |
| 102 | match cfg!(test) && !is_integ_test() { |
| 103 | true => { |
| 104 | let tempdir = tempfile::tempdir().expect("failed creating temporary directory"); |
| 105 | let fs = Self::Chroot(tempdir.into()); |
| 106 | futures::executor::block_on(fs.create_dir_all(ACTIVE_USER_HOME)) |
| 107 | .expect("failed to create test user home"); |
| 108 | |
| 109 | fs |
| 110 | }, |
| 111 | false => Self::Real, |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | pub fn is_chroot(&self) -> bool { |
| 116 | matches!(self, Self::Chroot(_)) |
nothing calls this directly
no test coverage detected