parent
ce708d0c98
commit
d0d7d0aca5
17 changed files with 550 additions and 355 deletions
File diff suppressed because it is too large
Load Diff
@ -1 +1,45 @@ |
||||
//async fn
|
||||
// get_personal_jobs(&self, url_param: Id)
|
||||
// report(&self, payload: impl OneOrVec<messaging::Reportable>)
|
||||
// dl(&self, file: String)
|
||||
// get_job(&self, job: Id)
|
||||
// get_jobs(&self)
|
||||
// get_agents(&self, agent: Option<Id>)
|
||||
// update_agent(&self, agent: Agent)
|
||||
// update_job(&self, job: FatJob)
|
||||
// update_result(&self, result: AssignedJob)
|
||||
// upload_jobs(&self, payload: impl OneOrVec<FatJob>)
|
||||
// del(&self, item: Id)
|
||||
// set_jobs(&self, agent: Id, job_idents: impl OneOrVec<String>)
|
||||
// get_agent_jobs(&self, agent: Option<Id>)
|
||||
// ping(&self)
|
||||
|
||||
use crate::fixtures::connections::*; |
||||
use u_lib::jobs::join_payload; |
||||
use u_lib::models::RawJob; |
||||
|
||||
#[rstest] |
||||
#[tokio::test] |
||||
async fn test_jobs_endpoints(client_panel: &HttpClient) { |
||||
let job_alias = "henlo"; |
||||
let job = RawJob::builder() |
||||
.with_shell("echo henlo") |
||||
.with_alias(job_alias) |
||||
.build() |
||||
.unwrap(); |
||||
let job_id = job.job.id; |
||||
let mut fat_job = join_payload(job).unwrap(); |
||||
|
||||
client_panel.upload_jobs(&fat_job).await.unwrap(); |
||||
|
||||
let fetched_job = client_panel.get_job(job_id, false).await.unwrap(); |
||||
assert_eq!(fat_job, fetched_job); |
||||
|
||||
fat_job.job.alias = Some("henlo2".to_string()); |
||||
client_panel.update_job(&fat_job).await.unwrap(); |
||||
|
||||
let fetched_job = client_panel.get_job(job_id, false).await.unwrap(); |
||||
assert_eq!(fat_job, fetched_job); |
||||
|
||||
client_panel.del(job_id).await.unwrap(); |
||||
client_panel.get_job(job_id, false).await.unwrap(); // should fail with 404
|
||||
} |
||||
|
@ -1,2 +1,3 @@ |
||||
mod api; |
||||
mod behaviour; |
||||
mod connection; |
||||
|
Loading…
Reference in new issue