Skip to content

Commit

Permalink
refactor: rename mod and function
Browse files Browse the repository at this point in the history
To follow production code conventions.
  • Loading branch information
josecelano committed Mar 17, 2023
1 parent 7d02279 commit fcce9f8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/common/tracker.rs → tests/common/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use torrust_tracker::bootstrap;
use torrust_tracker::tracker::services::tracker_factory;
use torrust_tracker::tracker::Tracker;

pub fn new_tracker(configuration: Arc<torrust_tracker_configuration::Configuration>) -> Arc<Tracker> {
pub fn setup_with_config(configuration: Arc<torrust_tracker_configuration::Configuration>) -> Arc<Tracker> {
bootstrap::app::initialize_static();

bootstrap::logging::setup(&configuration);
Expand Down
2 changes: 1 addition & 1 deletion tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub mod app;
pub mod fixtures;
pub mod http;
pub mod tracker;
pub mod udp;
4 changes: 2 additions & 2 deletions tests/servers/api/test_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use torrust_tracker::tracker::peer::Peer;
use torrust_tracker::tracker::Tracker;

use super::connection_info::ConnectionInfo;
use crate::common::tracker::new_tracker;
use crate::common::app::setup_with_config;

#[allow(clippy::module_name_repetitions, dead_code)]
pub type StoppedTestEnvironment = TestEnvironment<Stopped>;
Expand Down Expand Up @@ -39,7 +39,7 @@ impl TestEnvironment<Stopped> {
pub fn new_stopped(cfg: torrust_tracker_configuration::Configuration) -> Self {
let cfg = Arc::new(cfg);

let tracker = new_tracker(cfg.clone());
let tracker = setup_with_config(cfg.clone());

let api_server = api_server(cfg.http_api.clone());

Expand Down
4 changes: 2 additions & 2 deletions tests/servers/http/test_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use torrust_tracker::shared::bit_torrent::info_hash::InfoHash;
use torrust_tracker::tracker::peer::Peer;
use torrust_tracker::tracker::Tracker;

use crate::common::tracker::new_tracker;
use crate::common::app::setup_with_config;

#[allow(clippy::module_name_repetitions, dead_code)]
pub type StoppedTestEnvironment<I> = TestEnvironment<Stopped<I>>;
Expand Down Expand Up @@ -39,7 +39,7 @@ impl<I: HttpServerLauncher + 'static> TestEnvironment<Stopped<I>> {
pub fn new_stopped(cfg: torrust_tracker_configuration::Configuration) -> Self {
let cfg = Arc::new(cfg);

let tracker = new_tracker(cfg.clone());
let tracker = setup_with_config(cfg.clone());

let http_server = http_server(cfg.http_trackers[0].clone());

Expand Down
4 changes: 2 additions & 2 deletions tests/servers/udp/test_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use torrust_tracker::shared::bit_torrent::info_hash::InfoHash;
use torrust_tracker::tracker::peer::Peer;
use torrust_tracker::tracker::Tracker;

use crate::common::tracker::new_tracker;
use crate::common::app::setup_with_config;

#[allow(clippy::module_name_repetitions, dead_code)]
pub type StoppedTestEnvironment = TestEnvironment<Stopped>;
Expand Down Expand Up @@ -41,7 +41,7 @@ impl TestEnvironment<Stopped> {
pub fn new_stopped(cfg: torrust_tracker_configuration::Configuration) -> Self {
let cfg = Arc::new(cfg);

let tracker = new_tracker(cfg.clone());
let tracker = setup_with_config(cfg.clone());

let udp_server = udp_server(cfg.udp_trackers[0].clone());

Expand Down

0 comments on commit fcce9f8

Please sign in to comment.