Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhofer committed Aug 13, 2024
1 parent 781b99c commit 353cfbf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# our test dbs
*.db-*
*.db

# Generated by Cargo
# will have compiled files and executables
Expand Down
19 changes: 10 additions & 9 deletions src/models/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,20 +420,21 @@ mod tests {

#[test]
fn get_sequence() {
let conn = get_connection();
let conn = &mut get_connection();
let sequence = "AAATTTCCCGGG".to_string();
let seq = Sequence::create(&conn, "DNA", &sequence, true);
let bg = BlockGroup::create(&conn, "test", None, "test");
let block = Block::create(&conn, &seq, bg.id, 0, 12, "+");
let seq = Sequence::create(conn, "DNA", &sequence, true);
Collection::create(conn, "test collection");
let bg = BlockGroup::create(conn, "test collection", None, "test");
let block = Block::create(conn, &seq, bg.id, 0, 12, "+");
assert_eq!(
Block::get_sequence(&conn, block.id),
(sequence, "1".to_string())
Block::get_sequence(conn, block.id),
(sequence, "+".to_string())
);

let block = Block::create(&conn, &seq, bg.id, 0, 9, "+");
let block = Block::create(conn, &seq, bg.id, 0, 9, "+");
assert_eq!(
Block::get_sequence(&conn, block.id),
("AAATTTCCC".to_string(), "1".to_string())
Block::get_sequence(conn, block.id),
("AAATTTCCC".to_string(), "+".to_string())
);
}
}

0 comments on commit 353cfbf

Please sign in to comment.