You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tests.rs
    path of file: ./repos/rusoto/service_crategen/src/commands/generate/codegen
    
    the code of the file until where you have to start completion: use inflector::Inflector;
use std::fs;
use std::io::Write;
use std::path::{Path, PathBuf};

use self::util::case_insensitive_btreemap_get;
use super::{FileWriter, IoResult};
use crate::util;
use crate::Servic
    
fn generate_tests_body(service: &Service<'_>) -> Option<String> {
    let valid_tests = generate_response_tests(
        service,
        find_valid_responses_for_service(service),
        200,
        true,
    );
    // TODO: Find the true status code. Sadly, it isn't stored with the xml response.
    let error_tests = generate_response_tests(
        service,
        find_error_responses_for_service(service),
        400,
        false,
    );

    if valid_tests.is_some() || error_tests.is_some() {
        Some(format!(
            "
            extern crate rusoto_mock;

            use super::*;
            use self::rusoto_mock::*;
            use rusoto_core::Region as rusoto_region;

            {error_tests}
            {valid_tests}",
            error_tests = error_tests.unwrap_or_else(|| "".to_string()),
            valid_tests = valid_tests.unwrap_or_else(|| "".to_string())
        ))
    } else {
        None
    }
}