diff options
Diffstat (limited to 'test_utils/src/lib.rs')
| -rw-r--r-- | test_utils/src/lib.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index f463652..ff3833d 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs | |||
| @@ -1020,6 +1020,13 @@ pub fn get_proposal_branch_name( | |||
| 1020 | .hashtag("root"), | 1020 | .hashtag("root"), |
| 1021 | ], | 1021 | ], |
| 1022 | ))?; | 1022 | ))?; |
| 1023 | get_proposal_branch_name_from_events(&events, branch_name_in_event) | ||
| 1024 | } | ||
| 1025 | |||
| 1026 | pub fn get_proposal_branch_name_from_events( | ||
| 1027 | events: &Vec<nostr::Event>, | ||
| 1028 | branch_name_in_event: &str, | ||
| 1029 | ) -> Result<String> { | ||
| 1023 | for event in events { | 1030 | for event in events { |
| 1024 | if event.iter_tags().any(|t| { | 1031 | if event.iter_tags().any(|t| { |
| 1025 | !t.as_vec()[1].eq("revision-root") | 1032 | !t.as_vec()[1].eq("revision-root") |
| @@ -1075,6 +1082,15 @@ pub fn cli_tester_create_proposals() -> Result<GitTestRepo> { | |||
| 1075 | Ok(git_repo) | 1082 | Ok(git_repo) |
| 1076 | } | 1083 | } |
| 1077 | 1084 | ||
| 1085 | pub fn cli_tester_create_proposal_branches_ready_to_send() -> Result<GitTestRepo> { | ||
| 1086 | let git_repo = GitTestRepo::default(); | ||
| 1087 | git_repo.populate()?; | ||
| 1088 | create_and_populate_branch(&git_repo, FEATURE_BRANCH_NAME_1, "a", false)?; | ||
| 1089 | create_and_populate_branch(&git_repo, FEATURE_BRANCH_NAME_2, "b", false)?; | ||
| 1090 | create_and_populate_branch(&git_repo, FEATURE_BRANCH_NAME_3, "c", false)?; | ||
| 1091 | Ok(git_repo) | ||
| 1092 | } | ||
| 1093 | |||
| 1078 | pub fn create_and_populate_branch( | 1094 | pub fn create_and_populate_branch( |
| 1079 | test_repo: &GitTestRepo, | 1095 | test_repo: &GitTestRepo, |
| 1080 | branch_name: &str, | 1096 | branch_name: &str, |