-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(snos_job): Block number fetch + Dummy test
- Loading branch information
Showing
4 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
use rstest::rstest; | ||
|
||
#[cfg(test)] | ||
pub mod snos_job; | ||
|
||
#[cfg(test)] | ||
pub mod da_job; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use rstest::*; | ||
use std::collections::HashMap; | ||
|
||
use super::super::common::init_config; | ||
|
||
use crate::jobs::{ | ||
snos_job::SnosJob, | ||
types::{JobStatus, JobType}, | ||
Job, | ||
}; | ||
|
||
#[rstest] | ||
#[tokio::test] | ||
async fn test_create_job() { | ||
let config = init_config(None, None, None, None, None, None).await; | ||
|
||
let job = SnosJob.create_job(&config, String::from("0"), HashMap::default()).await; | ||
assert!(job.is_ok()); | ||
|
||
let job = job.unwrap(); | ||
let job_type = job.job_type; | ||
|
||
assert_eq!(job_type, JobType::SnosRun, "job_type should be SnosRun"); | ||
assert!(!(job.id.is_nil()), "id should not be nil"); | ||
assert_eq!(job.status, JobStatus::Created, "status should be Created"); | ||
assert_eq!(job.version, 0_i32, "version should be 0"); | ||
assert_eq!(job.external_id.unwrap_string().unwrap(), String::new(), "external_id should be empty string"); | ||
} |