nexgenomics 0.2.9

The official Rust crate for NexGenomics
Documentation

// tests/agents.rs


use nexgenomics::agents;
use nexgenomics::utils;

#[tokio::test]
#[cfg(feature="async")]
async fn test_agents() {
    let r = agents::get_agents().await.unwrap();
    println!("ASYNC GET AGENTS ^^^ {:#?} &&&&",r)

}

#[test]
#[cfg(feature="blocking")]
fn test_agents() {
    let r = agents::get_agents().unwrap();
    println!("BLOCKING GET AGENTS ^^^ {:#?} &&&&",r)
}


#[tokio::test]
#[cfg(feature="async")]
async fn test_agent_post_sentences() -> Result<(),Box<dyn std::error::Error>> {
    let agent_id = utils::get_key_from_config_file("test_agent_id").ok_or("configure a test_agent_id")?;
    let s:String = "xxxxx".into();
    let sentences = vec!["AAA","BBB","CCC", &s];
    agents::post_agent_sentences(&agent_id,sentences).await?;
    Ok(())
}