mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-12 17:32:21 -04:00
fix tests
This commit is contained in:
parent
372df6ff5e
commit
1053e0dd77
1 changed files with 25 additions and 7 deletions
|
@ -283,19 +283,23 @@ impl<'dbus> OrcaManager<'dbus> {
|
||||||
async fn stop_orca(&self) -> Result<()> {
|
async fn stop_orca(&self) -> Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::testing;
|
use crate::testing;
|
||||||
use tokio::fs::symlink;
|
use tokio::fs::copy;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_enable_disable() {
|
async fn test_enable_disable() {
|
||||||
let mut h = testing::start();
|
let mut h = testing::start();
|
||||||
let _ = symlink("data/test-orca-settings.conf", h.test.path().join("orca-settings.conf")).await;
|
copy(
|
||||||
|
"data/test-orca-settings.conf",
|
||||||
|
h.test.path().join("orca-settings.conf"),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
let mut manager =
|
let mut manager =
|
||||||
OrcaManager::new(&h.new_dbus().await.expect("new_dbus"))
|
OrcaManager::new(&h.new_dbus().await.expect("new_dbus"))
|
||||||
.await
|
.await
|
||||||
|
@ -312,7 +316,12 @@ mod test {
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_pitch() {
|
async fn test_pitch() {
|
||||||
let mut h = testing::start();
|
let mut h = testing::start();
|
||||||
let _ = symlink("data/test-orca-settings.conf", h.test.path().join("orca-settings.conf")).await;
|
copy(
|
||||||
|
"data/test-orca-settings.conf",
|
||||||
|
h.test.path().join("orca-settings.conf"),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
let mut manager =
|
let mut manager =
|
||||||
OrcaManager::new(&h.new_dbus().await.expect("new_dbus"))
|
OrcaManager::new(&h.new_dbus().await.expect("new_dbus"))
|
||||||
.await
|
.await
|
||||||
|
@ -333,7 +342,12 @@ mod test {
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_rate() {
|
async fn test_rate() {
|
||||||
let mut h = testing::start();
|
let mut h = testing::start();
|
||||||
let _ = symlink("data/test-orca-settings.conf", h.test.path().join("orca-settings.conf")).await;
|
copy(
|
||||||
|
"data/test-orca-settings.conf",
|
||||||
|
h.test.path().join("orca-settings.conf"),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
let mut manager =
|
let mut manager =
|
||||||
OrcaManager::new(&h.new_dbus().await.expect("new_dbus"))
|
OrcaManager::new(&h.new_dbus().await.expect("new_dbus"))
|
||||||
.await
|
.await
|
||||||
|
@ -354,7 +368,12 @@ mod test {
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_volume() {
|
async fn test_volume() {
|
||||||
let mut h = testing::start();
|
let mut h = testing::start();
|
||||||
let _ = symlink("data/test-orca-settings.conf", h.test.path().join("orca-settings.conf")).await;
|
copy(
|
||||||
|
"data/test-orca-settings.conf",
|
||||||
|
h.test.path().join("orca-settings.conf"),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
let mut manager =
|
let mut manager =
|
||||||
OrcaManager::new(&h.new_dbus().await.expect("new_dbus"))
|
OrcaManager::new(&h.new_dbus().await.expect("new_dbus"))
|
||||||
.await
|
.await
|
||||||
|
@ -371,5 +390,4 @@ mod test {
|
||||||
assert!(too_high_result.is_err());
|
assert!(too_high_result.is_err());
|
||||||
assert_eq!(manager.volume(), 5.0);
|
assert_eq!(manager.volume(), 5.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue