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