+gen_insert_msg
+
+for code in FILE_NOT_EMAIL READ_ONLY_DATABASE UPGRADE_REQUIRED PATH_ERROR; do
+ test_begin_subtest "EXIT_FAILURE when index_file returns $code"
+ test_expect_code 1 "notmuch_with_shim shim-$code insert < \"$gen_msg_filename\""
+
+ test_begin_subtest "success exit with --keep when index_file returns $code"
+ test_expect_code 0 "notmuch_with_shim shim-$code insert --keep < \"$gen_msg_filename\""
+done
+
+for code in OUT_OF_MEMORY XAPIAN_EXCEPTION ; do
+ test_begin_subtest "EX_TEMPFAIL when index_file returns $code"
+ test_expect_code 75 "notmuch_with_shim shim-$code insert < \"$gen_msg_filename\""
+
+ test_begin_subtest "success exit with --keep when index_file returns $code"
+ test_expect_code 0 "notmuch_with_shim shim-$code insert --keep < \"$gen_msg_filename\""
+done
+
+test_begin_subtest "insert converts mboxes on delivery"
+notmuch insert +unmboxed < "${TEST_DIRECTORY}"/corpora/insert/mbox-attachment.eml
+output=$(notmuch count tag:unmboxed)
+test_expect_equal "${output}" 1
+