common: enhance user repository with validation
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ic96bef36e3b4d1ea6b2db9752b26dd3a6a6a6964
This commit is contained in:
parent
a9e9599d5b
commit
caadb52f64
3 changed files with 131 additions and 26 deletions
|
|
@ -500,8 +500,12 @@ mod tests {
|
|||
#[test]
|
||||
fn test_create_evaluation_valid() {
|
||||
let e = CreateEvaluation {
|
||||
jobset_id: Uuid::new_v4(),
|
||||
commit_hash: "abc123".to_string(),
|
||||
jobset_id: Uuid::new_v4(),
|
||||
commit_hash: "abc123".to_string(),
|
||||
pr_number: None,
|
||||
pr_head_branch: None,
|
||||
pr_base_branch: None,
|
||||
pr_action: None,
|
||||
};
|
||||
assert!(e.validate().is_ok());
|
||||
}
|
||||
|
|
@ -509,8 +513,12 @@ mod tests {
|
|||
#[test]
|
||||
fn test_create_evaluation_invalid_hash() {
|
||||
let e = CreateEvaluation {
|
||||
jobset_id: Uuid::new_v4(),
|
||||
commit_hash: "not-hex!".to_string(),
|
||||
jobset_id: Uuid::new_v4(),
|
||||
commit_hash: "not-hex!".to_string(),
|
||||
pr_number: None,
|
||||
pr_head_branch: None,
|
||||
pr_base_branch: None,
|
||||
pr_action: None,
|
||||
};
|
||||
assert!(e.validate().is_err());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue