42 lines
1.2 KiB
Rust
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)
|
|
}
|
|
} |