upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/test_utils/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test_utils/src/lib.rs')
-rw-r--r--test_utils/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs
index ad187be..a693607 100644
--- a/test_utils/src/lib.rs
+++ b/test_utils/src/lib.rs
@@ -4,6 +4,7 @@ use anyhow::{bail, ensure, Context, Result};
4use dialoguer::theme::{ColorfulTheme, Theme}; 4use dialoguer::theme::{ColorfulTheme, Theme};
5use directories::ProjectDirs; 5use directories::ProjectDirs;
6use nostr::{self, Kind, Tag}; 6use nostr::{self, Kind, Tag};
7use nostr_sdk::serde_json;
7use once_cell::sync::Lazy; 8use once_cell::sync::Lazy;
8use rexpect::session::{Options, PtySession}; 9use rexpect::session::{Options, PtySession};
9use strip_ansi_escapes::strip_str; 10use strip_ansi_escapes::strip_str;
@@ -178,6 +179,11 @@ pub fn generate_repo_ref_event() -> nostr::Event {
178 .unwrap() 179 .unwrap()
179} 180}
180 181
182/// enough to fool event_is_patch_set_root
183pub fn get_pretend_proposal_root_event() -> nostr::Event {
184 serde_json::from_str(r#"{"id":"8cb75aa4cda10a3a0f3242dc49d36159d30b3185bf63414cf6ce17f5c14a73b1","pubkey":"f53e4bcd7a9cdef049cf6467d638a1321958acd3b71eb09823fd6fadb023d768","created_at":1714984571,"kind":1617,"tags":[["t","root"]],"content":"","sig":"6c197314b8c4c61da696dff888198333004d1ecc5d7bae2c554857f2f2b0d3ecc09369a5d8ba089c1bf89e3c6f5be40ade873fd698438ef8b303ffc6df35eb3f"}"#).unwrap()
185}
186
181/// wrapper for a cli testing tool - currently wraps rexpect and dialoguer 187/// wrapper for a cli testing tool - currently wraps rexpect and dialoguer
182/// 188///
183/// 1. allow more accurate articulation of expected behaviour 189/// 1. allow more accurate articulation of expected behaviour