1- use colink:: {
2- extensions:: instant_server:: { InstantRegistry , InstantServer } ,
3- CoLink ,
4- } ;
1+ mod common;
2+ use colink:: CoLink ;
3+ use common:: * ;
54use rand:: Rng ;
65
76#[ tokio:: test]
87async fn test_storage_macro_chunk ( ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > >
98{
10- let ( _ir, _is, cl) = get_colink_user ( ) . await ?;
9+ let ( _ir, _is, cl) = set_up_test_env_single_user ( ) . await ?;
1110
1211 let key_name = "storage_macro_test_chunk:$chunk" ;
1312 test_crud ( & cl, key_name) . await ?;
@@ -18,7 +17,7 @@ async fn test_storage_macro_chunk() -> Result<(), Box<dyn std::error::Error + Se
1817#[ tokio:: test]
1918async fn test_storage_macro_redis ( ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > >
2019{
21- let ( _ir, _is, cl) = get_colink_user ( ) . await ?;
20+ let ( _ir, _is, cl) = set_up_test_env_single_user ( ) . await ?;
2221
2322 cl. create_entry ( "storage_macro_test_redis:redis_url" , b"redis://localhost" )
2423 . await ?;
@@ -56,7 +55,7 @@ async fn test_crud(
5655#[ tokio:: test]
5756async fn test_storage_macro_append (
5857) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
59- let ( _ir, _is, cl) = get_colink_user ( ) . await ?;
58+ let ( _ir, _is, cl) = set_up_test_env_single_user ( ) . await ?;
6059
6160 let key_name = "storage_macro_test_append" ;
6261 test_append ( & cl, key_name, 10 as usize ) . await ?;
@@ -89,7 +88,7 @@ async fn test_append(
8988#[ tokio:: test]
9089async fn test_storage_macro_redis_append (
9190) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
92- let ( _ir, _is, cl) = get_colink_user ( ) . await ?;
91+ let ( _ir, _is, cl) = set_up_test_env_single_user ( ) . await ?;
9392
9493 cl. create_entry (
9594 "test_storage_macro_redis_append:redis_url" ,
@@ -105,7 +104,7 @@ async fn test_storage_macro_redis_append(
105104#[ tokio:: test]
106105async fn test_storage_macro_chunk_append (
107106) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
108- let ( _ir, _is, cl) = get_colink_user ( ) . await ?;
107+ let ( _ir, _is, cl) = set_up_test_env_single_user ( ) . await ?;
109108
110109 let key_name = "test_storage_macro_chunk_append:$chunk" ;
111110 test_append ( & cl, key_name, 5e6 as usize ) . await ?;
@@ -119,7 +118,7 @@ async fn test_storage_macro_chunk_append(
119118#[ tokio:: test]
120119async fn test_storage_macro_redis_chunk (
121120) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
122- let ( _ir, _is, cl) = get_colink_user ( ) . await ?;
121+ let ( _ir, _is, cl) = set_up_test_env_single_user ( ) . await ?;
123122
124123 cl. create_entry (
125124 "test_storage_macro_redis_chunk:redis_url" ,
@@ -131,13 +130,3 @@ async fn test_storage_macro_redis_chunk(
131130
132131 Ok ( ( ) )
133132}
134-
135- async fn get_colink_user ( ) -> Result <
136- ( InstantRegistry , InstantServer , CoLink ) ,
137- Box < dyn std:: error:: Error + Send + Sync + ' static > ,
138- > {
139- let ir = InstantRegistry :: new ( ) ;
140- let is = InstantServer :: new ( ) ;
141- let cl = is. get_colink ( ) . switch_to_generated_user ( ) . await ?;
142- Ok ( ( ir, is, cl) )
143- }
0 commit comments