A bit of test reorg
@@ -23,6 +23,8 @@ impl Command<u32> for GetUploadedFileCount {
#[cfg(test)]
mod tests {
+
+ mod get_uploaded_file_count {
use ::*;
use commands::*;
use file::*;
@@ -36,14 +38,18 @@ mod tests {
#[test]
fn processes_result() {
+ let cmd = GetUploadedFileCount::new();
+ assert_eq!(1, cmd.process_response(&test_result()).unwrap());
+ }
+
+ fn test_result() -> Vec<u8> {
let mut ret_msg = Vec::<u8>::new();
ret_msg.extend(RESP_HEADER.as_bytes());
ret_msg.push(1 as u8);
ret_msg.push(0 as u8);
ret_msg.push(0 as u8);
ret_msg.push(0 as u8);
- let count = File::process_file_count(&ret_msg);
- let cmd = GetUploadedFileCount::new();
- assert_eq!(1, cmd.process_response(&ret_msg).unwrap());
+ ret_msg
+ }
}
}
