X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Flei-import-http.t;h=d113d47904f15e4f23a606c813e4afe89ea39141;hb=28d5a8d647e3ab56cc5570af0d6f3ccf75dc91f2;hp=35cbf3693e4dc8737ab889d82ace111accf1c0f6;hpb=3f88776b8caeb7f58a99f065ba6650aed03c11ca;p=public-inbox.git diff --git a/t/lei-import-http.t b/t/lei-import-http.t index 35cbf369..d113d479 100644 --- a/t/lei-import-http.t +++ b/t/lei-import-http.t @@ -2,9 +2,8 @@ # Copyright (C) 2021 all contributors # License: AGPL-3.0+ use strict; use v5.10.1; use PublicInbox::TestCommon; -use PublicInbox::Spawn qw(which); require_mods(qw(lei -httpd)); -which('curl') or plan skip_all => "curl required for $0"; +require_cmd('curl'); my ($ro_home, $cfg_path) = setup_public_inboxes; my ($tmpdir, $for_destroy) = tmpdir; my $sock = tcp_server; @@ -17,6 +16,7 @@ test_lei({ tmpdir => $tmpdir }, sub { my $url = "http://$host_port/t2"; for my $p (qw(bogus@x/t.mbox.gz bogus@x/raw ?q=noresultever)) { ok(!lei('import', "$url/$p"), "/$p fails properly"); + like($lei_err, qr/curl.*404/, 'got curl 404'); } for my $p (qw(/ /T/ /t/ /t.atom)) { ok(!lei('import', "$url/m\@example$p"), "/$p fails"); @@ -39,5 +39,9 @@ test_lei({ tmpdir => $tmpdir }, sub { $res = json_utf8->decode($lei_out); is($res->[0]->{'m'}, '20180720072141.GA15957@example', 'imported search result') or diag explain($res); + + ok(!lei(qw(import --mail-sync), "$url/x\@example.com/raw"), + '--mail-sync fails on HTTP'); + like($lei_err, qr/--mail-sync/, 'error message notes --mail-sync'); }); done_testing;