package octez-libs
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
    
    
  sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a
    
    
  doc/octez-libs.event-logging-test-helpers/Tezos_event_logging_test_helpers/Mock_sink/index.html
Module Tezos_event_logging_test_helpers.Mock_sinkSource
A mock event sink that records handled events for verifying test expectations.
include Tezos_event_logging.Internal_event.SINK
A sink can store any required state, e.g. a database handle, in a value of the t type see configure.
Registered sinks are a distinguished by their URI scheme.
When a registered sink is activated the configure function is called to initialize it. The parameters should be encoded or obtained from the URI (the scheme of the URI is already uri_scheme).
val should_handle : 
  ?section:Tezos_event_logging.Internal_event.Section.t ->
  t ->
  _ Tezos_event_logging.Internal_event.event_definition ->
  boolPredicate deciding whether a sink should handle the event or not.
val handle : 
  t ->
  'a Tezos_event_logging.Internal_event.event_definition ->
  ?section:Tezos_event_logging.Internal_event.Section.t ->
  'a ->
  unit Tezos_error_monad.Error_monad.tzresult Lwt.tA sink's main function is to handle incoming events from the code base.
A function to be called on graceful termination of processes (e.g. to flush file-descriptors, etc.).
A filter can be applied when asserting the contents of the sink. This restricts assertions to events from a specific section or to those that have no section. The value filter has the following meaning:
- filter = None: only keep events that have no section.
- filter = Some s: only keep events with section- s.
Note that the filter is always passed as an optional parameter. It can be omited to keep all events.
type event = {- level : Tezos_event_logging.Internal_event.Level.t;
- section : Tezos_event_logging.Internal_event.Section.t option;
- name : string;
- message : string;
- json : Data_encoding.json;
}assert_has_event str filter strict e asserts that Mock_sink has recorded an event e, and fails with the assertion message str if not. If filter is set, only the events whose section is filter are searched. If strict is set, then e must be the only event recorded (subject to filter).
assert_has_events str filter strict es asserts that Mock_sink has recorded the list of events es, and fails with the assertion message str if not. If filter is set, only the events whose section is filter are searched. If strict is set, then es must be the only events recorded (subject to filter).
Clears recorded events, typically called in the initialization of each test.
Returns true if this sink has been activated
val testable_level : 
  Tezos_event_logging.Internal_event.Level.t Octez_alcotezt.Alcotest.testableval testable_section : 
  Tezos_event_logging.Internal_event.Section.t Octez_alcotezt.Alcotest.testable