You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Quality score length does not match sequence length");
30
+
}
31
+
}
32
+
33
+
#[test]
34
+
fntest_fetch_basic(){
35
+
// Create a temporary directory for test files
36
+
let temp_dir = TempDir::new().unwrap();
37
+
let output_path = temp_dir.path().join("output.fastq");
38
+
39
+
// Test BAM file
40
+
let test_bam = "gs://fc-8c3900db-633f-477f-96b3-fb31ae265c44/results/PBFlowcell/m84060_230907_210011_s2/reads/ccs/aligned/m84060_230907_210011_s2.bam";
assert!(output_path.exists(),"Output file was not created");
62
+
63
+
// Validate the format of the output FASTQ file
64
+
validate_fastq_output(&output_path);
65
+
}
66
+
67
+
#[test]
68
+
fntest_fetch_with_padding(){
69
+
let temp_dir = TempDir::new().unwrap();
70
+
let output_path = temp_dir.path().join("output.fastq");
71
+
let test_bam = "gs://fc-8c3900db-633f-477f-96b3-fb31ae265c44/results/PBFlowcell/m84060_230907_210011_s2/reads/ccs/aligned/m84060_230907_210011_s2.bam";
assert!(output_path.exists(),"Output file was not created");
91
+
validate_fastq_output(&output_path);
92
+
}
93
+
94
+
// #[test]
95
+
// fn test_fetch_with_haplotype() {
96
+
// let temp_dir = TempDir::new().unwrap();
97
+
// let output_path = temp_dir.path().join("output.fastq");
98
+
// let test_bam = "gs://fc-8c3900db-633f-477f-96b3-fb31ae265c44/results/PBFlowcell/m84060_230907_210011_s2/reads/ccs/aligned/m84060_230907_210011_s2.bam";
// assert!(output_path.exists(), "Output file was not created");
118
+
// validate_fastq_output(&output_path);
119
+
// }
120
+
121
+
#[test]
122
+
fntest_fetch_invalid_locus(){
123
+
let temp_dir = TempDir::new().unwrap();
124
+
let output_path = temp_dir.path().join("output.fastq");
125
+
let test_bam = "gs://fc-8c3900db-633f-477f-96b3-fb31ae265c44/results/PBFlowcell/m84060_230907_210011_s2/reads/ccs/aligned/m84060_230907_210011_s2.bam";
126
+
127
+
let output = Command::new("cargo")
128
+
.args([
129
+
"run",
130
+
"--",
131
+
"fetch",
132
+
"--loci",
133
+
"invalid_locus",
134
+
"--output",
135
+
output_path.to_str().unwrap(),
136
+
test_bam,
137
+
])
138
+
.output()
139
+
.expect("Failed to execute command");
140
+
141
+
// This should fail because the locus format is invalid
142
+
assert!(!output.status.success(),"Command should have failed");
143
+
}
144
+
145
+
#[test]
146
+
fntest_fetch_missing_required_args(){
147
+
let temp_dir = TempDir::new().unwrap();
148
+
let output_path = temp_dir.path().join("output.fastq");
149
+
150
+
let output = Command::new("cargo")
151
+
.args([
152
+
"run",
153
+
"--",
154
+
"fetch",
155
+
"--output",
156
+
output_path.to_str().unwrap(),
157
+
// Missing required --loci argument and BAM file
158
+
])
159
+
.output()
160
+
.expect("Failed to execute command");
161
+
162
+
// This should fail because required arguments are missing
163
+
assert!(!output.status.success(),"Command should have failed");
0 commit comments