Skip to content

Commit

Permalink
editoast: rename all test modules to follow rust idiom
Browse files Browse the repository at this point in the history
While the majority of editoast test modules are called "tests", some are
mistakenly called "test". Rename all test modules to "tests" so that they
follow rust idiom.

Signed-off-by: Loup Federico <[email protected]>
  • Loading branch information
Sh099078 committed Nov 7, 2024
1 parent cba6e94 commit 8461f3e
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion editoast/editoast_derive/src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pub fn expand_store(input: &DeriveInput) -> Result<TokenStream> {
}

#[cfg(test)]
mod test {
mod tests {
use darling::FromDeriveInput;
use pretty_assertions::assert_eq;

Expand Down
2 changes: 1 addition & 1 deletion editoast/editoast_osrdyne_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl HTTPClient {
}

#[cfg(test)]
mod test {
mod tests {
use super::*;

#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion editoast/editoast_schemas/src/infra/operational_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl OperationalPoint {
}

#[cfg(test)]
mod test {
mod tests {
use serde_json::from_str;

use super::OperationalPointExtensions;
Expand Down
2 changes: 1 addition & 1 deletion editoast/editoast_schemas/src/infra/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl OSRDIdentified for Signal {
}

#[cfg(test)]
mod test {
mod tests {
use serde_json::from_str;

use super::SignalExtensions;
Expand Down
2 changes: 1 addition & 1 deletion editoast/editoast_schemas/src/infra/speed_section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl OSRDIdentified for SpeedSection {
}

#[cfg(test)]
mod test {
mod tests {
use serde_json::from_str;
use serde_json::from_value;
use serde_json::json;
Expand Down
2 changes: 1 addition & 1 deletion editoast/editoast_schemas/src/infra/track_section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl TrackSection {
}

#[cfg(test)]
mod test {
mod tests {
use geojson;
use serde_json::from_str;

Expand Down
2 changes: 1 addition & 1 deletion editoast/editoast_search/src/sqlquery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fn value_to_sql(value: &TypedAst, string_bindings: &mut Vec<String>) -> String {
}

#[cfg(test)]
mod test {
mod tests {

use super::SqlQuery;
use crate::context::TypedAst;
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ impl From<reqwest::Error> for CoreError {
}

#[cfg(test)]
mod test {
mod tests {
use axum::http::StatusCode;
use pretty_assertions::assert_eq;
use reqwest::Method;
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/generated_data/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl GeneratedData for ErrorLayer {
}

#[cfg(test)]
mod test {
mod tests {
use rstest::rstest;

use super::buffer_stops;
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/generated_data/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl<'a> InvolvedObjects<'a> {
}

#[cfg(test)]
mod test {
mod tests {
use std::collections::HashSet;

use super::InvolvedObjects;
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/infra_cache/object_cache/route_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl Cache for Route {
}

#[cfg(test)]
mod test {
mod tests {

use crate::infra_cache::tests::create_small_infra_cache;
use crate::infra_cache::Graph;
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/models/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl Project {
}

#[cfg(test)]
pub mod test {
pub mod tests {
use pretty_assertions::assert_eq;
use rstest::rstest;

Expand Down
2 changes: 1 addition & 1 deletion editoast/src/models/stdcm_search_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl StdcmSearchEnvironmentChangeset {
}

#[cfg(test)]
pub mod test {
pub mod tests {
use chrono::NaiveDate;
use pretty_assertions::assert_eq;
use rstest::rstest;
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/models/study.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn dates_in_order(a: Option<Option<NaiveDate>>, b: Option<Option<NaiveDate>>) ->
}

#[cfg(test)]
pub mod test {
pub mod tests {
use pretty_assertions::assert_eq;
use rstest::rstest;

Expand Down
2 changes: 1 addition & 1 deletion editoast/src/views/infra/lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async fn get_line_bbox(
}

#[cfg(test)]
mod test {
mod tests {
use axum::http::StatusCode;
use editoast_schemas::infra::TrackSectionSncfExtension;
use editoast_schemas::primitives::Identifier;
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/views/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ async fn patch(
}

#[cfg(test)]
pub mod test {
pub mod tests {

use axum::http::StatusCode;
use pretty_assertions::assert_eq;
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/views/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ pub(super) struct SearchResultItemTrainSchedule {
pub struct SearchConfigFinder;

#[cfg(test)]
pub mod test {
pub mod tests {

use axum::http::StatusCode;
use pretty_assertions::assert_eq;
Expand Down
4 changes: 2 additions & 2 deletions editoast/src/views/stdcm_search_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ async fn retrieve_latest(
}

#[cfg(test)]
pub mod test {
pub mod tests {
use axum::http::StatusCode;
use chrono::NaiveDate;
use pretty_assertions::assert_eq;
use rstest::rstest;

use super::*;
use crate::models::stdcm_search_environment::test::stdcm_search_env_fixtures;
use crate::models::stdcm_search_environment::tests::stdcm_search_env_fixtures;
use crate::views::test_app::TestAppBuilder;
use crate::{Create, Retrieve};

Expand Down
2 changes: 1 addition & 1 deletion editoast/src/views/study.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ async fn list(
}

#[cfg(test)]
pub mod test {
pub mod tests {
use axum::http::StatusCode;
use pretty_assertions::assert_eq;
use rstest::rstest;
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/views/work_schedules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ async fn project_path(
}

#[cfg(test)]
pub mod test {
pub mod tests {
use axum::http::StatusCode;
use chrono::NaiveDate;
use pretty_assertions::assert_eq;
Expand Down

0 comments on commit 8461f3e

Please sign in to comment.