fix: resolve import errors in test modules and remove unused variables
Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
mod tests {
|
mod tests {
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use keep::compression_engine::gzip::CompressionEngineGZip;
|
use crate::compression_engine::gzip::CompressionEngineGZip;
|
||||||
use keep::compression_engine::CompressionEngine;
|
use crate::compression_engine::CompressionEngine;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_compression_engine_gzip() {
|
fn test_compression_engine_gzip() {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
mod tests {
|
mod tests {
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use keep::compression_engine::lz4::CompressionEngineLZ4;
|
use crate::compression_engine::lz4::CompressionEngineLZ4;
|
||||||
use keep::compression_engine::CompressionEngine;
|
use crate::compression_engine::CompressionEngine;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_compression_engine_lz4() {
|
fn test_compression_engine_lz4() {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
mod tests {
|
mod tests {
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use keep::compression_engine::none::CompressionEngineNone;
|
use crate::compression_engine::none::CompressionEngineNone;
|
||||||
use keep::compression_engine::CompressionEngine;
|
use crate::compression_engine::CompressionEngine;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_compression_engine_none() {
|
fn test_compression_engine_none() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use keep::compression_engine::program::CompressionEngineProgram;
|
use crate::compression_engine::program::CompressionEngineProgram;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_compression_engine_program_creation() {
|
fn test_compression_engine_program_creation() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use keep::compression_engine::CompressionType;
|
use crate::compression_engine::CompressionType;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use keep::compression_engine::{self, CompressionType};
|
use crate::compression_engine::{self, CompressionType};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_compression_engine_factory() {
|
fn test_compression_engine_factory() {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
use std::path::PathBuf;
|
use crate::db;
|
||||||
use keep::db;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_database_connection() {
|
fn test_database_connection() {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
use keep::db;
|
use crate::db;
|
||||||
use keep::db::Meta;
|
use crate::db::Meta;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_database_meta_operations() {
|
fn test_database_meta_operations() {
|
||||||
@@ -25,11 +25,11 @@ mod tests {
|
|||||||
assert!(insert_result.is_ok());
|
assert!(insert_result.is_ok());
|
||||||
|
|
||||||
// Try to get meta for non-existent item
|
// Try to get meta for non-existent item
|
||||||
let item = keep::db::Item {
|
let item = crate::db::Item {
|
||||||
id: 999, // Non-existent item
|
id: 999, // Non-existent item
|
||||||
ts: chrono::Utc::now(),
|
ts: chrono::Utc::now(),
|
||||||
size: 0,
|
size: 0,
|
||||||
compression: keep::compression_engine::CompressionType::None,
|
compression: crate::compression_engine::CompressionType::None,
|
||||||
};
|
};
|
||||||
|
|
||||||
let metas = db::get_item_meta(&conn, &item);
|
let metas = db::get_item_meta(&conn, &item);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
use keep::db;
|
use crate::db;
|
||||||
use keep::db::Tag;
|
use crate::db::Tag;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_database_tag_operations() {
|
fn test_database_tag_operations() {
|
||||||
@@ -34,11 +34,11 @@ mod tests {
|
|||||||
let conn = db::open(db_path).expect("Failed to open database");
|
let conn = db::open(db_path).expect("Failed to open database");
|
||||||
|
|
||||||
// Try to delete tags for non-existent item
|
// Try to delete tags for non-existent item
|
||||||
let item = keep::db::Item {
|
let item = crate::db::Item {
|
||||||
id: 999, // Non-existent item
|
id: 999, // Non-existent item
|
||||||
ts: chrono::Utc::now(),
|
ts: chrono::Utc::now(),
|
||||||
size: 0,
|
size: 0,
|
||||||
compression: keep::compression_engine::CompressionType::None,
|
compression: crate::compression_engine::CompressionType::None,
|
||||||
};
|
};
|
||||||
|
|
||||||
let delete_result = db::delete_item_tags(&conn, item);
|
let delete_result = db::delete_item_tags(&conn, item);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use keep::meta_plugin::digest::*;
|
use crate::meta_plugin::digest::*;
|
||||||
use keep::meta_plugin::MetaPlugin;
|
use crate::meta_plugin::MetaPlugin;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use keep::meta_plugin::program::MetaPluginProgram;
|
use crate::meta_plugin::program::MetaPluginProgram;
|
||||||
use keep::meta_plugin::MetaPlugin;
|
use crate::meta_plugin::MetaPlugin;
|
||||||
use std::io::Write;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_meta_plugin_program_creation() {
|
fn test_meta_plugin_program_creation() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use keep::meta_plugin::system::*;
|
use crate::meta_plugin::system::*;
|
||||||
use keep::meta_plugin::MetaPlugin;
|
use crate::meta_plugin::MetaPlugin;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_cwd_meta_plugin() {
|
fn test_cwd_meta_plugin() {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ mod tests {
|
|||||||
|
|
||||||
// Create an empty test file
|
// Create an empty test file
|
||||||
{
|
{
|
||||||
let file = File::create(&file_path).expect("Failed to create empty test file");
|
let _file = File::create(&file_path).expect("Failed to create empty test file");
|
||||||
// File is automatically closed when it goes out of scope
|
// File is automatically closed when it goes out of scope
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use axum::http::{HeaderMap, HeaderValue};
|
use axum::http::{HeaderMap, HeaderValue};
|
||||||
use keep::modes::server::common::check_auth;
|
use crate::modes::server::common::check_auth;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_auth_with_no_password_required() {
|
fn test_auth_with_no_password_required() {
|
||||||
|
|||||||
Reference in New Issue
Block a user