Skip to content

Commit 750969d

Browse files
committed
refactor: [#56] rename methods
1 parent 0063289 commit 750969d

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

tests/upgrades/from_v1_0_0_to_v2_0_0/testers/torrent_tester.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl TorrentTester {
5555
.unwrap();
5656
}
5757

58-
pub async fn assert(&self, upload_path: &str) {
58+
pub async fn assert_data_in_destiny_db(&self, upload_path: &str) {
5959
let filepath = self.torrent_file_path(upload_path, self.test_data.torrent.torrent_id);
6060
let torrent_file = read_torrent_from_file(&filepath).unwrap();
6161

tests/upgrades/from_v1_0_0_to_v2_0_0/testers/tracker_key_tester.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl TrackerKeyTester {
4141
}
4242

4343
/// Table `torrust_tracker_keys`
44-
pub async fn assert(&self) {
44+
pub async fn assert_data_in_destiny_db(&self) {
4545
let imported_key = self
4646
.destiny_database
4747
.get_tracker_key(self.test_data.tracker_key.key_id)

tests/upgrades/from_v1_0_0_to_v2_0_0/testers/user_tester.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl UserTester {
4747
.unwrap();
4848
}
4949

50-
pub async fn assert(&self) {
50+
pub async fn assert_data_in_destiny_db(&self) {
5151
self.assert_user().await;
5252
self.assert_user_profile().await;
5353
self.assert_user_authentication().await;

tests/upgrades/from_v1_0_0_to_v2_0_0/upgrader.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async fn upgrades_data_from_version_v1_0_0_to_v2_0_0() {
4444
// The datetime when the upgrader is executed
4545
let execution_time = datetime_iso_8601();
4646

47-
// Load data into database v1
47+
// Load data into source database in version v1.0.0
4848

4949
let user_tester = UserTester::new(
5050
source_database.clone(),
@@ -68,18 +68,21 @@ async fn upgrades_data_from_version_v1_0_0_to_v2_0_0() {
6868
torrent_tester.load_data_into_source_db().await;
6969

7070
// Run the upgrader
71-
let args = Arguments {
72-
source_database_file: source_database_file.clone(),
73-
destiny_database_file: destiny_database_file.clone(),
74-
upload_path: upload_path.clone(),
75-
};
76-
upgrade(&args, &execution_time).await;
71+
upgrade(
72+
&Arguments {
73+
source_database_file: source_database_file.clone(),
74+
destiny_database_file: destiny_database_file.clone(),
75+
upload_path: upload_path.clone(),
76+
},
77+
&execution_time,
78+
)
79+
.await;
7780

78-
// Assertions in database v2
81+
// Assertions for data transferred to the new database in version v2.0.0
7982

80-
user_tester.assert().await;
81-
tracker_key_tester.assert().await;
82-
torrent_tester.assert(&upload_path).await;
83+
user_tester.assert_data_in_destiny_db().await;
84+
tracker_key_tester.assert_data_in_destiny_db().await;
85+
torrent_tester.assert_data_in_destiny_db(&upload_path).await;
8386
}
8487

8588
async fn source_db_connection(source_database_file: &str) -> Arc<SqliteDatabaseV1_0_0> {

0 commit comments

Comments
 (0)