@@ -1198,70 +1198,70 @@ impl ImportProgressBar {
11981198
11991199#[ cfg( test) ]
12001200mod tests {
1201- use super :: * ;
1202-
1203- #[ tokio:: test]
1204- #[ ignore]
1205- #[ allow( unused_variables, unreachable_code, clippy:: diverging_sub_expression) ]
1206- async fn test_doc_import ( ) -> Result < ( ) > {
1207- let temp_dir = tempfile:: tempdir ( ) . context ( "tempdir" ) ?;
1208-
1209- tokio:: fs:: create_dir_all ( temp_dir. path ( ) )
1210- . await
1211- . context ( "create dir all" ) ?;
1212-
1213- let foobar = temp_dir. path ( ) . join ( "foobar" ) ;
1214- tokio:: fs:: write ( foobar, "foobar" )
1215- . await
1216- . context ( "write foobar" ) ?;
1217- let foo = temp_dir. path ( ) . join ( "foo" ) ;
1218- tokio:: fs:: write ( foo, "foo" ) . await . context ( "write foo" ) ?;
1219-
1220- let data_dir = tempfile:: tempdir ( ) ?;
1221-
1222- // let node = crate::commands::start::start_node(data_dir.path(), None, None).await?;
1223- // let node = todo!();
1224- // let client = node.client();
1225- let docs: docs:: Client = todo ! ( ) ;
1226- let authors = docs. authors ( ) ;
1227- let doc = docs. create ( ) . await . context ( "doc create" ) ?;
1228- let author = authors. create ( ) . await . context ( "author create" ) ?;
1229-
1230- // set up command, getting iroh node
1231- let cli = ConsoleEnv :: for_console ( data_dir. path ( ) . to_owned ( ) , & authors)
1232- . await
1233- . context ( "ConsoleEnv" ) ?;
1234- // let iroh = iroh::client::Iroh::connect_path(data_dir.path())
1235- // .await
1236- // .context("rpc connect")?;
1237- // let iroh = todo!();
1238- let docs = todo ! ( ) ;
1239- let blobs = todo ! ( ) ;
1240-
1241- let command = DocCommands :: Import {
1242- doc : Some ( doc. id ( ) ) ,
1243- author : Some ( author) ,
1244- prefix : None ,
1245- path : temp_dir. path ( ) . to_string_lossy ( ) . into ( ) ,
1246- in_place : false ,
1247- no_prompt : true ,
1248- } ;
1249-
1250- command
1251- . run ( & docs, & blobs, & cli)
1252- . await
1253- . context ( "DocCommands run" ) ?;
1254-
1255- let keys: Vec < _ > = doc
1256- . get_many ( Query :: all ( ) )
1257- . await
1258- . context ( "doc get many" ) ?
1259- . try_collect ( )
1260- . await ?;
1261- assert_eq ! ( 2 , keys. len( ) ) ;
1262-
1263- // todo
1264- // iroh.shutdown(false).await?;
1265- Ok ( ( ) )
1266- }
1201+ // use super::*;
1202+
1203+ // #[tokio::test]
1204+ // #[ignore]
1205+ // #[allow(unused_variables, unreachable_code, clippy::diverging_sub_expression)]
1206+ // async fn test_doc_import() -> Result<()> {
1207+ // let temp_dir = tempfile::tempdir().context("tempdir")?;
1208+
1209+ // tokio::fs::create_dir_all(temp_dir.path())
1210+ // .await
1211+ // .context("create dir all")?;
1212+
1213+ // let foobar = temp_dir.path().join("foobar");
1214+ // tokio::fs::write(foobar, "foobar")
1215+ // .await
1216+ // .context("write foobar")?;
1217+ // let foo = temp_dir.path().join("foo");
1218+ // tokio::fs::write(foo, "foo").await.context("write foo")?;
1219+
1220+ // let data_dir = tempfile::tempdir()?;
1221+
1222+ // // let node = crate::commands::start::start_node(data_dir.path(), None, None).await?;
1223+ // // let node = todo!();
1224+ // // let client = node.client();
1225+ // let docs: docs::Client = todo!();
1226+ // let authors = docs.authors();
1227+ // let doc = docs.create().await.context("doc create")?;
1228+ // let author = authors.create().await.context("author create")?;
1229+
1230+ // // set up command, getting iroh node
1231+ // let cli = ConsoleEnv::for_console(data_dir.path().to_owned(), &authors)
1232+ // .await
1233+ // .context("ConsoleEnv")?;
1234+ // // let iroh = iroh::client::Iroh::connect_path(data_dir.path())
1235+ // // .await
1236+ // // .context("rpc connect")?;
1237+ // // let iroh = todo!();
1238+ // let docs = todo!();
1239+ // let blobs = todo!();
1240+
1241+ // let command = DocCommands::Import {
1242+ // doc: Some(doc.id()),
1243+ // author: Some(author),
1244+ // prefix: None,
1245+ // path: temp_dir.path().to_string_lossy().into(),
1246+ // in_place: false,
1247+ // no_prompt: true,
1248+ // };
1249+
1250+ // command
1251+ // .run(&docs, &blobs, &cli)
1252+ // .await
1253+ // .context("DocCommands run")?;
1254+
1255+ // let keys: Vec<_> = doc
1256+ // .get_many(Query::all())
1257+ // .await
1258+ // .context("doc get many")?
1259+ // .try_collect()
1260+ // .await?;
1261+ // assert_eq!(2, keys.len());
1262+
1263+ // // todo
1264+ // // iroh.shutdown(false).await?;
1265+ // Ok(())
1266+ // }
12671267}
0 commit comments