MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / test_event

Function test_event

crates/openshell-ocsf/src/format/jsonl.rs:31–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 use crate::objects::{Metadata, Product};
30
31 fn test_event() -> OcsfEvent {
32 let mut base = BaseEventData::new(
33 0,
34 "Base Event",
35 0,
36 "Uncategorized",
37 99,
38 "Other",
39 SeverityId::Informational,
40 Metadata {
41 version: "1.7.0".to_string(),
42 product: Product::openshell_sandbox("0.1.0"),
43 profiles: vec!["container".to_string()],
44 uid: Some("sandbox-abc123".to_string()),
45 log_source: None,
46 },
47 );
48 base.set_time(1_742_054_400_000);
49 base.set_message("Test event");
50 OcsfEvent::Base(BaseEvent { base })
51 }
52
53 #[test]
54 fn test_to_json_has_required_fields() {

Callers 3

test_to_json_line_formatFunction · 0.70

Calls 2

set_timeMethod · 0.80
set_messageMethod · 0.80

Tested by

no test coverage detected