|
1 | 1 | use csv::Writer; |
2 | 2 | use fileflow::fileflow::enums::database_engine::DatabaseEngine; |
3 | 3 | use fileflow::fileflow::stuct::config::db_config::DatabaseConfig; |
4 | | -use fileflow::fileflow::stuct::config::save_config::SaveConfig; |
5 | 4 | use std::error::Error; |
6 | 5 | use std::fs::File; |
7 | 6 | use std::path::PathBuf; |
@@ -61,29 +60,6 @@ pub fn get_test_maridb_config() -> DatabaseConfig { |
61 | 60 | sqlite_file_path: String::new(), |
62 | 61 | } |
63 | 62 | } |
64 | | -/// Get a test save configuration |
65 | | -pub fn get_test_save_config(config_name: &str) -> SaveConfig { |
66 | | - SaveConfig { |
67 | | - config_name: config_name.into(), |
68 | | - db_driver: DatabaseEngine::SQLite, |
69 | | - db_host: String::new(), |
70 | | - port: String::new(), |
71 | | - username: String::new(), |
72 | | - password: String::new(), |
73 | | - db_name: "test_db".into(), |
74 | | - sqlite_file_path: String::new(), |
75 | | - } |
76 | | -} |
77 | | - |
78 | | -/// Delete the configuration file with the given file name |
79 | | -pub fn delete_config_file(config_file_name: &str) -> Result<(), Box<dyn Error>> { |
80 | | - if !std::path::Path::new(&config_file_name).exists() { |
81 | | - println!("File does not exist"); |
82 | | - Err("Failed to create SQLite file")?; |
83 | | - } |
84 | | - std::fs::remove_file(config_file_name).expect("Failed to remove SQLite file"); |
85 | | - Ok(()) |
86 | | -} |
87 | 63 |
|
88 | 64 | /// Create a test SQLite database file if it does not exist and return the file path |
89 | 65 | pub fn create_test_db(db_name: &str) -> String { |
|
0 commit comments