use assert_cmd::cargo::cargo_bin_cmd;
#[test]
fn test_docs() {
let test_dir = "tests/fixtures/test_registry/test_docs/base/0.1/";
let mut cmd = cargo_bin_cmd!("ml-cellar");
cmd.arg("docs").arg(test_dir);
let assert = cmd.assert().success();
let output = String::from_utf8_lossy(&assert.get_output().stdout);
assert!(output.contains("test_docs/base/0.1"));
assert!(output.contains("Device: RTX4090"));
assert!(output.contains("Training time: 2 GPU * 32 Batchsize * 4.7 days"));
assert!(output.contains("name: myCOCO"));
assert!(output.contains("mAP (0.5:0.95) | 0.40453625"));
assert!(output.contains("bicycle | 916 | 0.2899"));
}
#[test]
fn test_docs_missing_path() {
let test_dir = "tests/fixtures/no_exist_path";
let mut cmd = cargo_bin_cmd!("ml-cellar");
cmd.arg("docs").arg(test_dir);
cmd.assert().failure();
}
#[test]
fn test_docs_missing_template_file() {
let test_dir = "tests/fixtures/test_registry/test_docs_for_missing_template_file/base/0.1/";
let mut cmd = cargo_bin_cmd!("ml-cellar");
cmd.arg("docs").arg(test_dir);
cmd.assert().failure();
}
#[test]
fn test_docs_missing_config_setting() {
let test_dir = "tests/fixtures/test_registry/test_docs_for_missing_config/base/0.1/";
let mut cmd = cargo_bin_cmd!("ml-cellar");
cmd.arg("docs").arg(test_dir);
cmd.assert().failure();
}