#include "file_test_utilities.hpp" #include "metadata.hpp" #include #include #include namespace redfish { namespace { /* Example from Redfish and OData whitepaper. https://www.dmtf.org/sites/default/files/standards/documents/DSP2052_1.0.0.pdf */ constexpr std::string_view content = "\n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "\n"; TEST(MetadataGet, GetOneFile) { TemporaryFileHandle file(content); std::filesystem::path path{file.stringPath}; EXPECT_EQ( getMetadataPieceForFile(path), std::format(" \n" " \n" " \n", path.filename().string())); EXPECT_EQ(getMetadataPieceForFile("DoesNotExist_v1.xml"), ""); } } // namespace } // namespace redfish