upleb.uk

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

summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-02-14 08:54:27 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-02-14 08:54:27 +0000
commit62d7f2fb26f2843fa8f7ff8b988bac14e5f756e2 (patch)
treea647093fbe3b84fad628345c7514496232f1cf77 /tests
parentc0847f928c32adb0b4dfc3b73ee77fa3cdb5ec21 (diff)
feat!: move `claim` > `init`
this aligns with gitstr and is more intuative the idea behind using claim to indicate that it is only for maintainersto do is valid but its too confusing
Diffstat (limited to 'tests')
-rw-r--r--tests/init.rs (renamed from tests/claim.rs)46
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/claim.rs b/tests/init.rs
index fa7adcc..56ce332 100644
--- a/tests/claim.rs
+++ b/tests/init.rs
@@ -28,7 +28,7 @@ mod when_repo_not_previously_claimed {
28 Ok(test_repo) 28 Ok(test_repo)
29 } 29 }
30 30
31 fn cli_tester_claim(git_repo: &GitTestRepo) -> CliTester { 31 fn cli_tester_init(git_repo: &GitTestRepo) -> CliTester {
32 CliTester::new_from_dir( 32 CliTester::new_from_dir(
33 &git_repo.dir, 33 &git_repo.dir,
34 [ 34 [
@@ -37,7 +37,7 @@ mod when_repo_not_previously_claimed {
37 "--password", 37 "--password",
38 TEST_PASSWORD, 38 TEST_PASSWORD,
39 "--disable-cli-spinners", 39 "--disable-cli-spinners",
40 "claim", 40 "init",
41 "--title", 41 "--title",
42 "example-name", 42 "example-name",
43 "--description", 43 "--description",
@@ -52,7 +52,7 @@ mod when_repo_not_previously_claimed {
52 ) 52 )
53 } 53 }
54 54
55 async fn prep_run_claim() -> Result<( 55 async fn prep_run_init() -> Result<(
56 Relay<'static>, 56 Relay<'static>,
57 Relay<'static>, 57 Relay<'static>,
58 Relay<'static>, 58 Relay<'static>,
@@ -85,7 +85,7 @@ mod when_repo_not_previously_claimed {
85 85
86 // // check relay had the right number of events 86 // // check relay had the right number of events
87 let cli_tester_handle = std::thread::spawn(move || -> Result<()> { 87 let cli_tester_handle = std::thread::spawn(move || -> Result<()> {
88 let mut p = cli_tester_claim(&git_repo); 88 let mut p = cli_tester_init(&git_repo);
89 p.expect_end_eventually()?; 89 p.expect_end_eventually()?;
90 for p in [51, 52, 53, 55, 56] { 90 for p in [51, 52, 53, 55, 56] {
91 relay::shutdown_relay(8000 + p)?; 91 relay::shutdown_relay(8000 + p)?;
@@ -111,7 +111,7 @@ mod when_repo_not_previously_claimed {
111 #[tokio::test] 111 #[tokio::test]
112 #[serial] 112 #[serial]
113 async fn only_1_repository_kind_event_sent_to_user_relays() -> Result<()> { 113 async fn only_1_repository_kind_event_sent_to_user_relays() -> Result<()> {
114 let (_, _, r53, r55, _) = prep_run_claim().await?; 114 let (_, _, r53, r55, _) = prep_run_init().await?;
115 for relay in [&r53, &r55] { 115 for relay in [&r53, &r55] {
116 assert_eq!( 116 assert_eq!(
117 relay 117 relay
@@ -128,7 +128,7 @@ mod when_repo_not_previously_claimed {
128 #[tokio::test] 128 #[tokio::test]
129 #[serial] 129 #[serial]
130 async fn only_1_repository_kind_event_sent_to_specified_repo_relays() -> Result<()> { 130 async fn only_1_repository_kind_event_sent_to_specified_repo_relays() -> Result<()> {
131 let (_, _, _, r55, r56) = prep_run_claim().await?; 131 let (_, _, _, r55, r56) = prep_run_init().await?;
132 for relay in [&r55, &r56] { 132 for relay in [&r55, &r56] {
133 assert_eq!( 133 assert_eq!(
134 relay 134 relay
@@ -145,7 +145,7 @@ mod when_repo_not_previously_claimed {
145 #[tokio::test] 145 #[tokio::test]
146 #[serial] 146 #[serial]
147 async fn event_not_sent_to_fallback_relay() -> Result<()> { 147 async fn event_not_sent_to_fallback_relay() -> Result<()> {
148 let (r51, r52, _, _, _) = prep_run_claim().await?; 148 let (r51, r52, _, _, _) = prep_run_init().await?;
149 for relay in [&r51, &r52] { 149 for relay in [&r51, &r52] {
150 assert_eq!( 150 assert_eq!(
151 relay 151 relay
@@ -192,7 +192,7 @@ mod when_repo_not_previously_claimed {
192 192
193 // // check relay had the right number of events 193 // // check relay had the right number of events
194 let cli_tester_handle = std::thread::spawn(move || -> Result<()> { 194 let cli_tester_handle = std::thread::spawn(move || -> Result<()> {
195 let mut p = cli_tester_claim(&git_repo); 195 let mut p = cli_tester_init(&git_repo);
196 p.expect_end_eventually()?; 196 p.expect_end_eventually()?;
197 197
198 let yaml_path = git_repo.dir.join("maintainers.yaml"); 198 let yaml_path = git_repo.dir.join("maintainers.yaml");
@@ -247,7 +247,7 @@ mod when_repo_not_previously_claimed {
247 #[serial] 247 #[serial]
248 async fn d_replaceable_event_identifier_defaults_to_root_commit_id_shorthand() 248 async fn d_replaceable_event_identifier_defaults_to_root_commit_id_shorthand()
249 -> Result<()> { 249 -> Result<()> {
250 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; 250 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_init())?;
251 for relay in [&r53, &r55, &r56] { 251 for relay in [&r53, &r55, &r56] {
252 let event: &nostr::Event = relay 252 let event: &nostr::Event = relay
253 .events 253 .events
@@ -268,7 +268,7 @@ mod when_repo_not_previously_claimed {
268 #[tokio::test] 268 #[tokio::test]
269 #[serial] 269 #[serial]
270 async fn root_commit_as_reference() -> Result<()> { 270 async fn root_commit_as_reference() -> Result<()> {
271 let (_, _, r53, r55, r56) = prep_run_claim().await?; 271 let (_, _, r53, r55, r56) = prep_run_init().await?;
272 for relay in [&r53, &r55, &r56] { 272 for relay in [&r53, &r55, &r56] {
273 let event: &nostr::Event = relay 273 let event: &nostr::Event = relay
274 .events 274 .events
@@ -285,7 +285,7 @@ mod when_repo_not_previously_claimed {
285 #[tokio::test] 285 #[tokio::test]
286 #[serial] 286 #[serial]
287 async fn name() -> Result<()> { 287 async fn name() -> Result<()> {
288 let (_, _, r53, r55, r56) = prep_run_claim().await?; 288 let (_, _, r53, r55, r56) = prep_run_init().await?;
289 for relay in [&r53, &r55, &r56] { 289 for relay in [&r53, &r55, &r56] {
290 let event: &nostr::Event = relay 290 let event: &nostr::Event = relay
291 .events 291 .events
@@ -306,7 +306,7 @@ mod when_repo_not_previously_claimed {
306 #[tokio::test] 306 #[tokio::test]
307 #[serial] 307 #[serial]
308 async fn description() -> Result<()> { 308 async fn description() -> Result<()> {
309 let (_, _, r53, r55, r56) = prep_run_claim().await?; 309 let (_, _, r53, r55, r56) = prep_run_init().await?;
310 for relay in [&r53, &r55, &r56] { 310 for relay in [&r53, &r55, &r56] {
311 let event: &nostr::Event = relay 311 let event: &nostr::Event = relay
312 .events 312 .events
@@ -323,7 +323,7 @@ mod when_repo_not_previously_claimed {
323 #[tokio::test] 323 #[tokio::test]
324 #[serial] 324 #[serial]
325 async fn git_server() -> Result<()> { 325 async fn git_server() -> Result<()> {
326 let (_, _, r53, r55, r56) = prep_run_claim().await?; 326 let (_, _, r53, r55, r56) = prep_run_init().await?;
327 for relay in [&r53, &r55, &r56] { 327 for relay in [&r53, &r55, &r56] {
328 let event: &nostr::Event = relay 328 let event: &nostr::Event = relay
329 .events 329 .events
@@ -342,7 +342,7 @@ mod when_repo_not_previously_claimed {
342 #[tokio::test] 342 #[tokio::test]
343 #[serial] 343 #[serial]
344 async fn relays() -> Result<()> { 344 async fn relays() -> Result<()> {
345 let (_, _, r53, r55, r56) = prep_run_claim().await?; 345 let (_, _, r53, r55, r56) = prep_run_init().await?;
346 for relay in [&r53, &r55, &r56] { 346 for relay in [&r53, &r55, &r56] {
347 let event: &nostr::Event = relay 347 let event: &nostr::Event = relay
348 .events 348 .events
@@ -364,7 +364,7 @@ mod when_repo_not_previously_claimed {
364 #[tokio::test] 364 #[tokio::test]
365 #[serial] 365 #[serial]
366 async fn web() -> Result<()> { 366 async fn web() -> Result<()> {
367 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; 367 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_init())?;
368 for relay in [&r53, &r55, &r56] { 368 for relay in [&r53, &r55, &r56] {
369 let event: &nostr::Event = relay 369 let event: &nostr::Event = relay
370 .events 370 .events
@@ -386,7 +386,7 @@ mod when_repo_not_previously_claimed {
386 #[test] 386 #[test]
387 #[serial] 387 #[serial]
388 fn current_user_in_maintainers() -> Result<()> { 388 fn current_user_in_maintainers() -> Result<()> {
389 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_claim())?; 389 let (_, _, r53, r55, r56) = futures::executor::block_on(prep_run_init())?;
390 for relay in [&r53, &r55, &r56] { 390 for relay in [&r53, &r55, &r56] {
391 let event: &nostr::Event = relay 391 let event: &nostr::Event = relay
392 .events 392 .events
@@ -435,7 +435,7 @@ mod when_repo_not_previously_claimed {
435 435
436 // // check relay had the right number of events 436 // // check relay had the right number of events
437 let cli_tester_handle = std::thread::spawn(move || -> Result<()> { 437 let cli_tester_handle = std::thread::spawn(move || -> Result<()> {
438 let mut p = cli_tester_claim(&git_repo); 438 let mut p = cli_tester_init(&git_repo);
439 expect_msgs_first(&mut p)?; 439 expect_msgs_first(&mut p)?;
440 relay::expect_send_with_progress( 440 relay::expect_send_with_progress(
441 &mut p, 441 &mut p,
@@ -487,7 +487,7 @@ mod when_repo_not_previously_claimed {
487 Ok(test_repo) 487 Ok(test_repo)
488 } 488 }
489 489
490 fn cli_tester_claim(git_repo: &GitTestRepo) -> CliTester { 490 fn cli_tester_init(git_repo: &GitTestRepo) -> CliTester {
491 CliTester::new_from_dir( 491 CliTester::new_from_dir(
492 &git_repo.dir, 492 &git_repo.dir,
493 [ 493 [
@@ -496,7 +496,7 @@ mod when_repo_not_previously_claimed {
496 "--password", 496 "--password",
497 TEST_PASSWORD, 497 TEST_PASSWORD,
498 "--disable-cli-spinners", 498 "--disable-cli-spinners",
499 "claim", 499 "init",
500 "--title", 500 "--title",
501 "example-name", 501 "example-name",
502 "--description", 502 "--description",
@@ -508,7 +508,7 @@ mod when_repo_not_previously_claimed {
508 ) 508 )
509 } 509 }
510 510
511 async fn prep_run_claim() -> Result<( 511 async fn prep_run_init() -> Result<(
512 Relay<'static>, 512 Relay<'static>,
513 Relay<'static>, 513 Relay<'static>,
514 Relay<'static>, 514 Relay<'static>,
@@ -541,7 +541,7 @@ mod when_repo_not_previously_claimed {
541 541
542 // // check relay had the right number of events 542 // // check relay had the right number of events
543 let cli_tester_handle = std::thread::spawn(move || -> Result<()> { 543 let cli_tester_handle = std::thread::spawn(move || -> Result<()> {
544 let mut p = cli_tester_claim(&git_repo); 544 let mut p = cli_tester_init(&git_repo);
545 p.expect_end_eventually()?; 545 p.expect_end_eventually()?;
546 for p in [51, 52, 53, 55, 56] { 546 for p in [51, 52, 53, 55, 56] {
547 relay::shutdown_relay(8000 + p)?; 547 relay::shutdown_relay(8000 + p)?;
@@ -567,7 +567,7 @@ mod when_repo_not_previously_claimed {
567 #[tokio::test] 567 #[tokio::test]
568 #[serial] 568 #[serial]
569 async fn relays_match_user_write_relays() -> Result<()> { 569 async fn relays_match_user_write_relays() -> Result<()> {
570 let (_, _, r53, r55, _) = prep_run_claim().await?; 570 let (_, _, r53, r55, _) = prep_run_init().await?;
571 for relay in [&r53, &r55] { 571 for relay in [&r53, &r55] {
572 let event: &nostr::Event = relay 572 let event: &nostr::Event = relay
573 .events 573 .events
@@ -613,7 +613,7 @@ mod when_repo_not_previously_claimed {
613 613
614 // // check relay had the right number of events 614 // // check relay had the right number of events
615 let cli_tester_handle = std::thread::spawn(move || -> Result<()> { 615 let cli_tester_handle = std::thread::spawn(move || -> Result<()> {
616 let mut p = cli_tester_claim(&git_repo); 616 let mut p = cli_tester_init(&git_repo);
617 expect_msgs_first(&mut p)?; 617 expect_msgs_first(&mut p)?;
618 relay::expect_send_with_progress( 618 relay::expect_send_with_progress(
619 &mut p, 619 &mut p,