File tree 2 files changed +26
-17
lines changed
2 files changed +26
-17
lines changed Original file line number Diff line number Diff line change @@ -874,23 +874,6 @@ mod tests {
874
874
}
875
875
}
876
876
877
- #[ tokio:: test]
878
- async fn should_collect_torrent_metrics ( ) {
879
- let tracker = public_tracker ( ) ;
880
-
881
- let torrents_metrics = tracker. in_memory_torrent_repository . get_torrents_metrics ( ) ;
882
-
883
- assert_eq ! (
884
- torrents_metrics,
885
- TorrentsMetrics {
886
- complete: 0 ,
887
- downloaded: 0 ,
888
- incomplete: 0 ,
889
- torrents: 0
890
- }
891
- ) ;
892
- }
893
-
894
877
#[ tokio:: test]
895
878
async fn it_should_return_the_peers_for_a_given_torrent ( ) {
896
879
let tracker = public_tracker ( ) ;
Original file line number Diff line number Diff line change @@ -101,3 +101,29 @@ impl InMemoryTorrentRepository {
101
101
self . torrents . import_persistent ( persistent_torrents) ;
102
102
}
103
103
}
104
+
105
+ #[ cfg( test) ]
106
+ mod tests {
107
+ use std:: sync:: Arc ;
108
+
109
+ use torrust_tracker_primitives:: torrent_metrics:: TorrentsMetrics ;
110
+
111
+ use crate :: core:: torrent:: repository:: in_memory:: InMemoryTorrentRepository ;
112
+
113
+ #[ tokio:: test]
114
+ async fn should_collect_torrent_metrics ( ) {
115
+ let in_memory_torrent_repository = Arc :: new ( InMemoryTorrentRepository :: default ( ) ) ;
116
+
117
+ let torrents_metrics = in_memory_torrent_repository. get_torrents_metrics ( ) ;
118
+
119
+ assert_eq ! (
120
+ torrents_metrics,
121
+ TorrentsMetrics {
122
+ complete: 0 ,
123
+ downloaded: 0 ,
124
+ incomplete: 0 ,
125
+ torrents: 0
126
+ }
127
+ ) ;
128
+ }
129
+ }
You can’t perform that action at this time.
0 commit comments