20 nb::module_ m_clock_mock = m.def_submodule(
"clock_mock",
"Clock mock utilities for testing");
22 nb::class_<PClockMock>(m_clock_mock,
"PClockMock")
27 .def(
"now", &PClockMock::now,
28 "Get the mocked current time")
30 .def(
"sleep", [](
const PClockMock &c, time_t ellapsedTime) {
31 c.sleep(ellapsedTime);
33 "Sleep for the given elapsed time (no real sleep in mock)")
36 .def(
"setCurrentTime", [](PClockMock &c, time_t currentTime) {
37 c.setCurrentTime(currentTime);
39 "Set the mocked current time")
41 .def(
"setMockPrefix", [](PClockMock &c,
const std::string &prefix) {
42 c.setMockPrefix(prefix);
44 "Set the mock prefix for logging")
46 .def(
"resetIndex", &PClockMock::resetIndex,
47 "Reset the mock index to start from the beginning of the mock data")
49 .def(
"close", &PClockMock::close,
50 "Close the mock and release resources");
53 m_clock_mock.def(
"phoenix_createMockBackend", [](PClockMock &c,
const std::string & prefix) ->
bool {
54 return phoenix_createMockBackend(c, prefix);
56 nb::arg(
"c"), nb::arg(
"prefix") =
"",
57 "Create the mock backend with the given prefix");