Skip to content

Commit

Permalink
Skip test if test data is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
oeb25 committed Feb 17, 2024
1 parent cc4c94c commit 6aaa604
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
7 changes: 6 additions & 1 deletion crates/core/src/widgets/thesaurus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,12 @@ mod tests {

#[test]
fn build_dict() {
let dict = Dictionary::build("../../data/english-wordnet-2022-subset.ttl").unwrap();
let data_path = "../../data/english-wordnet-2022-subset.ttl";
if std::fs::File::open(&data_path).is_err() {
// Skip the test if the test data is not available
return;
}
let dict = Dictionary::build(data_path).unwrap();

let infos = dict.get(Lemma("barely".to_string()));

Expand Down
15 changes: 13 additions & 2 deletions crates/zimba/src/wiki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,13 @@ mod tests {

#[test]
fn test_article_iterator() {
let zim = ZimFile::open("../../data/test.zim").unwrap();
let data_path = "../../data/test.zim";
if std::fs::File::open(&data_path).is_err() {
// Skip the test if the test data is not available
return;
}

let zim = ZimFile::open(data_path).unwrap();
let mut iter = ArticleIterator::new(&zim).unwrap();

let article = iter.next().unwrap();
Expand All @@ -271,7 +277,12 @@ mod tests {

#[test]
fn test_image_iterator() {
let zim = ZimFile::open("../../data/test.zim").unwrap();
let data_path = "../../data/test.zim";
if std::fs::File::open(&data_path).is_err() {
// Skip the test if the test data is not available
return;
}
let zim = ZimFile::open(data_path).unwrap();
let mut iter = ImageIterator::new(&zim).unwrap();

let image = iter.next().unwrap();
Expand Down

0 comments on commit 6aaa604

Please sign in to comment.