34#include <boost/test/unit_test.hpp>
38#include <wx/filename.h>
39#include <wx/wfstream.h>
59 wxFileName settings( wxFileName::CreateTempFileName(
"kicad_qa_issue24477_" ) );
60 wxRemoveFile( settings.GetFullPath() );
61 settings.SetExt(
"kicad_httplib" );
63 wxFFileOutputStream out( settings.GetFullPath() );
68 " \"meta\": { \"version\": 1.0 },\n"
69 " \"name\": \"Unreachable HTTP Library\",\n"
71 " \"type\": \"REST_API\",\n"
72 " \"api_version\": \"v1\",\n"
73 " \"root_url\": \"http://localhost:1/\",\n"
78 out.WriteAll(
json, std::strlen(
json ) );
100 std::vector<LIB_SYMBOL*> symbols;
105 std::vector<wxString> names = { wxS(
"stale" ) };
107 BOOST_CHECK( names.empty() );
113 BOOST_CHECK( desc.IsEmpty() );
115 wxRemoveFile( settings.GetFullPath() );
124 source.
root_url =
"http://localhost:1/v1/";
bool IsValidEndpoint() const
std::string GetLastError() const
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
A KiCad HTTP library provides both symbol and footprint metadata, so there are "shim" plugins on both...
wxString GetSubLibraryDescription(const wxString &aName) override
Gets a description of a sublibrary.
void SetLibraryManagerAdapter(SYMBOL_LIBRARY_ADAPTER *aAdapter) override
Some library plugins need to interface with other loaded libraries.
void EnumerateSymbolLib(wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.
void GetSubLibraryNames(std::vector< wxString > &aNames) override
Retrieves a list of sub-libraries in this library.
An interface to the global shared library manager that is schematic-specific and linked to one projec...
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(SubLibraryQueriesSurviveNetworkLoss)
The sub-library queries used while building the library tree must not crash when the HTTP endpoint is...
static wxFileName writeUnreachableHttpLib()
Issue #24477.