drasi_bootstrap_scriptfile/
lib.rs1#![allow(unexpected_cfgs)]
2pub mod descriptor;
47pub mod script_file;
48pub mod script_reader;
49pub mod script_types;
50
51pub use drasi_lib::bootstrap::ScriptFileBootstrapConfig;
52pub use script_file::{ScriptFileBootstrapProvider, ScriptFileBootstrapProviderBuilder};
53
54#[cfg(feature = "dynamic-plugin")]
58drasi_plugin_sdk::export_plugin!(
59 plugin_id = "scriptfile-bootstrap",
60 core_version = env!("CARGO_PKG_VERSION"),
61 lib_version = env!("CARGO_PKG_VERSION"),
62 plugin_version = env!("CARGO_PKG_VERSION"),
63 source_descriptors = [],
64 reaction_descriptors = [],
65 bootstrap_descriptors = [descriptor::ScriptFileBootstrapDescriptor],
66);
67
68#[cfg(test)]
69mod tests {
70 use super::*;
71
72 #[test]
73 fn test_scriptfile_bootstrap_builder_empty() {
74 let provider = ScriptFileBootstrapProviderBuilder::new().build();
75 let _ = provider;
77 }
78
79 #[test]
80 fn test_scriptfile_bootstrap_builder_single_file() {
81 let provider = ScriptFileBootstrapProviderBuilder::new()
82 .with_file("/path/to/file.jsonl")
83 .build();
84 let _ = provider;
85 }
86
87 #[test]
88 fn test_scriptfile_bootstrap_builder_multiple_files() {
89 let provider = ScriptFileBootstrapProviderBuilder::new()
90 .with_file("/path/to/file1.jsonl")
91 .with_file("/path/to/file2.jsonl")
92 .with_file("/path/to/file3.jsonl")
93 .build();
94 let _ = provider;
95 }
96
97 #[test]
98 fn test_scriptfile_bootstrap_builder_with_file_paths() {
99 let paths = vec![
100 "/data/nodes.jsonl".to_string(),
101 "/data/relations.jsonl".to_string(),
102 ];
103 let provider = ScriptFileBootstrapProviderBuilder::new()
104 .with_file_paths(paths)
105 .build();
106 let _ = provider;
107 }
108
109 #[test]
110 fn test_scriptfile_bootstrap_from_provider_method() {
111 let provider = ScriptFileBootstrapProvider::builder()
113 .with_file("/initial/data.jsonl")
114 .build();
115 let _ = provider;
116 }
117
118 #[test]
119 fn test_scriptfile_bootstrap_builder_default() {
120 let provider = ScriptFileBootstrapProviderBuilder::default().build();
121 let _ = provider;
122 }
123
124 #[test]
125 fn test_scriptfile_bootstrap_provider_default() {
126 let provider = ScriptFileBootstrapProvider::default();
128 let _ = provider;
129 }
130
131 #[test]
132 fn test_scriptfile_bootstrap_new_with_config() {
133 let config = ScriptFileBootstrapConfig {
135 file_paths: vec!["/bootstrap/nodes.jsonl".to_string()],
136 };
137 let provider = ScriptFileBootstrapProvider::new(config);
138 let _ = provider;
139 }
140
141 #[test]
142 fn test_scriptfile_bootstrap_with_paths() {
143 let provider = ScriptFileBootstrapProvider::with_paths(vec![
145 "/bootstrap/nodes.jsonl".to_string(),
146 "/bootstrap/relations.jsonl".to_string(),
147 ]);
148 let _ = provider;
149 }
150}