testing
This commit is contained in:
1 parent
9b4eda6a9d
commit
3c1634d1e3
65 files changed
+2355
-100
No files matched your search
@@ -1,9 +1,10 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
mod radarr_data_tests {
|
||||
use bimap::BiMap;
|
||||
use chrono::{DateTime, Utc};
|
||||
use pretty_assertions::{assert_eq, assert_str_eq};
|
||||
|
||||
use serde_json::Number;
|
||||
use crate::app::context_clues::{
|
||||
BLOCKLIST_CONTEXT_CLUES, DOWNLOADS_CONTEXT_CLUES, INDEXERS_CONTEXT_CLUES,
|
||||
ROOT_FOLDERS_CONTEXT_CLUES, SYSTEM_CONTEXT_CLUES,
|
||||
@@ -61,6 +62,35 @@ mod tests {
|
||||
assert_movie_info_tabs_reset!(radarr_data);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tag_ids_to_display() {
|
||||
let mut tags_map = BiMap::new();
|
||||
tags_map.insert(3, "test 3".to_owned());
|
||||
tags_map.insert(2, "test 2".to_owned());
|
||||
tags_map.insert(1, "test 1".to_owned());
|
||||
let radarr_data = RadarrData {
|
||||
tags_map,
|
||||
..RadarrData::default()
|
||||
};
|
||||
|
||||
assert_str_eq!(radarr_data.tag_ids_to_display(&[Number::from(1), Number::from(2)]), "test 1, test 2");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_sorted_quality_profile_names() {
|
||||
let mut quality_profile_map = BiMap::new();
|
||||
quality_profile_map.insert(3, "test 3".to_owned());
|
||||
quality_profile_map.insert(2, "test 2".to_owned());
|
||||
quality_profile_map.insert(1, "test 1".to_owned());
|
||||
let radarr_data = RadarrData {
|
||||
quality_profile_map,
|
||||
..RadarrData::default()
|
||||
};
|
||||
let expected_quality_profile_vec = vec!["test 1".to_owned(), "test 2".to_owned(), "test 3".to_owned()];
|
||||
|
||||
assert_iter_eq!(radarr_data.sorted_quality_profile_names(), expected_quality_profile_vec);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_radarr_data_defaults() {
|
||||
let radarr_data = RadarrData::default();
|
||||
|
||||
Reference in new issue
Block a user