@@ -193,51 +193,10 @@ impl Session {
193193
194194#[ cfg( test) ]
195195mod tests {
196- use num_traits:: FromPrimitive ;
197-
198196 use super :: * ;
199197 use crate :: chat:: send_msg;
200198 use crate :: test_utils:: TestContext ;
201199
202- #[ test]
203- fn test_downloadstate_values ( ) {
204- // values may be written to disk and must not change
205- assert_eq ! ( DownloadState :: Done , DownloadState :: default ( ) ) ;
206- assert_eq ! ( DownloadState :: Done , DownloadState :: from_i32( 0 ) . unwrap( ) ) ;
207- assert_eq ! (
208- DownloadState :: Available ,
209- DownloadState :: from_i32( 10 ) . unwrap( )
210- ) ;
211- assert_eq ! ( DownloadState :: Failure , DownloadState :: from_i32( 20 ) . unwrap( ) ) ;
212- assert_eq ! (
213- DownloadState :: InProgress ,
214- DownloadState :: from_i32( 1000 ) . unwrap( )
215- ) ;
216- }
217-
218- #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
219- async fn test_download_limit ( ) -> Result < ( ) > {
220- let t = TestContext :: new_alice ( ) . await ;
221-
222- assert_eq ! ( t. download_limit( ) . await ?, None ) ;
223-
224- t. set_config ( Config :: DownloadLimit , Some ( "200000" ) ) . await ?;
225- assert_eq ! ( t. download_limit( ) . await ?, Some ( 200000 ) ) ;
226-
227- t. set_config ( Config :: DownloadLimit , Some ( "20000" ) ) . await ?;
228- assert_eq ! ( t. download_limit( ) . await ?, Some ( MIN_DOWNLOAD_LIMIT ) ) ;
229-
230- t. set_config ( Config :: DownloadLimit , None ) . await ?;
231- assert_eq ! ( t. download_limit( ) . await ?, None ) ;
232-
233- for val in & [ "0" , "-1" , "-100" , "" , "foo" ] {
234- t. set_config ( Config :: DownloadLimit , Some ( val) ) . await ?;
235- assert_eq ! ( t. download_limit( ) . await ?, None ) ;
236- }
237-
238- Ok ( ( ) )
239- }
240-
241200 #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
242201 async fn test_update_download_state ( ) -> Result < ( ) > {
243202 let t = TestContext :: new_alice ( ) . await ;
0 commit comments