fix: use fixed testfiles location

This commit is contained in:
ThetaDev 2023-03-25 23:18:49 +01:00
parent 3a2e4c8abe
commit 7bcff13eb8
20 changed files with 80 additions and 62 deletions

View file

@ -330,20 +330,22 @@ impl VideoPlayer {
mod tests {
use std::{fs::File, io::BufReader};
use super::*;
use once_cell::sync::Lazy;
use path_macro::path;
use rstest::rstest;
use super::*;
use crate::util::tests::TESTFILES;
static PLAYER_ML: Lazy<VideoPlayer> = Lazy::new(|| {
let json_path = path!("testfiles" / "player_model" / "multilanguage.json");
let json_path = path!(*TESTFILES / "player_model" / "multilanguage.json");
let json_file = File::open(json_path).unwrap();
serde_json::from_reader(BufReader::new(json_file)).unwrap()
});
static PLAYER_HDR: Lazy<VideoPlayer> = Lazy::new(|| {
let json_path = path!("testfiles" / "player_model" / "hdr.json");
let json_path = path!(*TESTFILES / "player_model" / "hdr.json");
let json_file = File::open(json_path).unwrap();
serde_json::from_reader(BufReader::new(json_file)).unwrap()