Files
projectmycelium/tests/tests_archive/ux_suite/utils/test_fixtures.rs
2025-09-01 21:37:01 -04:00

42 lines
1.2 KiB
Rust

//! Test Fixtures
//!
//! Common test data and setup helpers
use crate::environment::*;
/// Common test data
pub struct TestFixtures;
impl TestFixtures {
/// Sample SSH public key for testing
pub fn sample_ssh_public_key() -> &'static str {
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC7vbqajDhA+17ZAdaZcZSjJF7Dp+iSbq3 test@example.com"
}
/// Sample product data for testing
pub fn sample_product_data() -> serde_json::Value {
serde_json::json!({
"id": "test-product-1",
"name": "Test VM Instance",
"category": "compute",
"price": 15.0,
"currency": "TFC",
"description": "Test virtual machine instance"
})
}
/// Get test environment with pre-configured data
pub async fn setup_test_environment() -> Result<UXTestEnvironment, Box<dyn std::error::Error>> {
// Initialize logging
env_logger::builder()
.filter_level(log::LevelFilter::Info)
.try_init()
.ok();
// Create test environment
let environment = UXTestEnvironment::new().await?;
log::info!("Test environment setup complete");
Ok(environment)
}
}