Skip to content

Commit 1cc40f1

Browse files
committed
[tests] Fix SFTP output strings.
1 parent 54fbe65 commit 1cc40f1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

tests/test_sftp_client.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ TEST_F(SFTPClient, push_dir_fail_dir)
502502
mock_logger->expect_log(mpl::Level::error, fmt::format("cannot create remote directory \"{}\": {}",
503503
target_path.u8string() + "/dir", err));
504504
mock_logger->expect_log(mpl::Level::error,
505-
fmt::format("cannot set permissions for remote directory {}: {}", target_path, err));
505+
fmt::format("cannot set permissions for remote directory \"{}\": {}", target_path, err));
506506
EXPECT_FALSE(sftp_client.push(source_path, target_path, mp::SFTPClient::Flag::Recursive));
507507
}
508508

tests/test_sftp_utils.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,10 @@ TEST_F(SFTPUtils, get_full_remote_dir_target__target_exists_not_dir)
315315
{
316316
REPLACE(sftp_stat, [](auto, auto path) { return get_dummy_attr(path, SSH_FILEXFER_TYPE_REGULAR); });
317317

318-
MP_EXPECT_THROW_THAT(
319-
MP_SFTPUTILS.get_remote_dir_target(nullptr, source_path, target_path, false), mp::SFTPError,
320-
mpt::match_what(StrEq(fmt::format("cannot overwrite remote non-directory {} with directory", target_path))));
318+
MP_EXPECT_THROW_THAT(MP_SFTPUTILS.get_remote_dir_target(nullptr, source_path, target_path, false),
319+
mp::SFTPError,
320+
mpt::match_what(StrEq(
321+
fmt::format("cannot overwrite remote non-directory \"{}\" with directory", target_path))));
321322
}
322323

323324
TEST_F(SFTPUtils, get_full_remote_dir_target__target_not_exists_can_create)
@@ -345,8 +346,9 @@ TEST_F(SFTPUtils, get_full_remote_dir_target__target_not_exists_cannot_create)
345346

346347
sftp_session_struct sftp{};
347348
MP_EXPECT_THROW_THAT(
348-
MP_SFTPUTILS.get_remote_dir_target(&sftp, source_path, target_path, false), mp::SFTPError,
349-
mpt::match_what(StrEq(fmt::format("cannot create remote directory {}: {}", target_path, err))));
349+
MP_SFTPUTILS.get_remote_dir_target(&sftp, source_path, target_path, false),
350+
mp::SFTPError,
351+
mpt::match_what(StrEq(fmt::format("cannot create remote directory \"{}\": {}", target_path, err))));
350352
}
351353

352354
TEST_F(SFTPUtils, get_full_remote_dir_target__target_is_dir_child_is_not)

0 commit comments

Comments
 (0)