diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-12-06 16:52:00 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-12-06 16:52:11 +0100 |
commit | 20d5ee08b45ab904244447d5b464364bcff71e90 (patch) | |
tree | 6a8a942c7dba4e6070613f59e6c12952359cbf05 /src | |
parent | 92f0e2912be7b6ba30a72a8530a66ddba41700f1 (diff) |
Add test for posting helloworld
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/profile/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/profile/mod.rs b/src/profile/mod.rs index e82a939..ef1b7a2 100644 --- a/src/profile/mod.rs +++ b/src/profile/mod.rs @@ -157,6 +157,7 @@ impl Profile { #[cfg(test)] mod tests { use super::*; + use std::convert::TryFrom; use crate::client::Client; use crate::config::Config; use crate::ipfs_client::IpfsClient; @@ -170,4 +171,17 @@ mod tests { assert!(exit.is_ok(), "Not cleanly exited: {:?}", exit); } + #[tokio::test] + async fn test_create_profile_and_helloworld() { + let _ = env_logger::try_init(); + let profile = Profile::new_inmemory(Config::default(), "test-create-profile-and-helloworld").await; + assert!(profile.is_ok()); + let profile = profile.unwrap(); + let head = profile.head(); + let exp_cid = cid::Cid::try_from("bafyreie4haukbqj7u6vogjfvaxbwg73b7bzi7nqxbnkvv77dvwcqg5wtpe").unwrap(); + assert_eq!(*head, exp_cid, "{} != {}", *head, exp_cid); + let exit = profile.exit().await; + assert!(exit.is_ok(), "Not cleanly exited: {:?}", exit); + } + } |