Skip to content

Commit

Permalink
test fix and pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yao-msft committed Dec 23, 2024
1 parent 2f30737 commit 511c2c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw
Original file line number Diff line number Diff line change
Expand Up @@ -2762,7 +2762,7 @@ Please specify one of them using the --source option to proceed.</value>
<value>Specify the account to be used for authentication</value>
</data>
<data name="SourceAddFailedAuthenticationNotSupported" xml:space="preserve">
<value>Failed to add source. This winget version does not support the source's authentication method. Try upgrade to latest winget version.</value>
<value>Failed to add source. This winget version does not support the source's authentication method. Try upgrading to latest winget version.</value>
<comment>{Locked="winget"}</comment>
</data>
<data name="SourceRequiresAuthentication" xml:space="preserve">
Expand Down Expand Up @@ -3191,7 +3191,7 @@ Please specify one of them using the --source option to proceed.</value>
<value>The package installer requires authentication. Authentication prompt may appear when necessary. Authenticated information will be shared with the installer download url.</value>
</data>
<data name="InstallerDownloadAuthenticationNotSupported" xml:space="preserve">
<value>Failed to download installer. This winget version does not support the installer download authentication method. Try upgrade to latest winget version.</value>
<value>Failed to download installer. This winget version does not support the installer download authentication method. Try upgrading to latest winget version.</value>
<comment>{Locked="winget"}</comment>
</data>
<data name="InstallerDownloadAuthenticationFailed" xml:space="preserve">
Expand Down
8 changes: 7 additions & 1 deletion src/AppInstallerCLITests/DownloadFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ TEST_CASE("DownloadFlow_DownloadCommandProhibited", "[DownloadFlow][workflow]")

AppInstaller::Utility::DownloadResult ValidateAzureBlobStorageAuthHeaders(
const std::string&,
const std::filesystem::path&,
const std::filesystem::path& dest,
AppInstaller::Utility::DownloadType,
AppInstaller::IProgressCallback&,
std::optional<AppInstaller::Utility::DownloadInfo> info)
Expand All @@ -43,6 +43,10 @@ AppInstaller::Utility::DownloadResult ValidateAzureBlobStorageAuthHeaders(
REQUIRE(info->RequestHeaders[1].Name == "x-ms-version");
// Not validating x-ms-version value

std::ofstream file(dest, std::ofstream::out);
file << "test";
file.close();

AppInstaller::Utility::DownloadResult result;
result.Sha256Hash = AppInstaller::Utility::SHA256::ConvertToBytes("65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B");
return result;
Expand Down Expand Up @@ -70,6 +74,8 @@ TEST_CASE("DownloadFlow_DownloadWithInstallerAuthenticationSuccess", "[DownloadF
TestContext context{ downloadOutput, std::cin };
auto previousThreadGlobals = context.SetForCurrentThread();
context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("ManifestV1_10-InstallerAuthentication.yaml").GetPath().u8string());
TestCommon::TempDirectory tempDirectory("TempDownload");
context.Args.AddArg(Execution::Args::Type::DownloadDirectory, tempDirectory.GetPath().u8string());

DownloadCommand download({});
download.Execute(context);
Expand Down

0 comments on commit 511c2c7

Please sign in to comment.