Refactor VPN proxy routing and session handling
This commit is contained in:
@@ -7,7 +7,7 @@ use component_detection::{
|
||||
detect_proxyfier_install_with_host, proxyfier_component_from_detection, ProxyfierDetectionHost,
|
||||
ProxyfierEngine, RegistryInstallEntry,
|
||||
};
|
||||
use models::{ComponentState};
|
||||
use models::ComponentState;
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
path::{Path, PathBuf},
|
||||
@@ -25,7 +25,10 @@ fn detects_existing_proxifyre_from_registry_install_location() {
|
||||
|
||||
assert_eq!(detected.engine, ProxyfierEngine::ProxiFyre);
|
||||
assert_eq!(detected.install_dir, PathBuf::from(r"C:\Tools\ProxiFyre"));
|
||||
assert_eq!(detected.config_path, Some(PathBuf::from(r"C:\Tools\ProxiFyre\app-config.json")));
|
||||
assert_eq!(
|
||||
detected.config_path,
|
||||
Some(PathBuf::from(r"C:\Tools\ProxiFyre\app-config.json"))
|
||||
);
|
||||
assert!(detected.running);
|
||||
|
||||
let component = proxyfier_component_from_detection(Some(&detected));
|
||||
@@ -56,7 +59,10 @@ fn env_override_can_point_to_portable_proxifyre_install() {
|
||||
.expect("env override should be checked before common paths");
|
||||
|
||||
assert_eq!(detected.engine, ProxyfierEngine::ProxiFyre);
|
||||
assert_eq!(detected.executable_path, PathBuf::from(r"D:\Portable\ProxiFyre\ProxiFyre.exe"));
|
||||
assert_eq!(
|
||||
detected.executable_path,
|
||||
PathBuf::from(r"D:\Portable\ProxiFyre\ProxiFyre.exe")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -118,17 +124,16 @@ impl ProxyfierDetectionHost for MockHost {
|
||||
}
|
||||
|
||||
fn path_exists(&self, path: &Path) -> bool {
|
||||
self.paths.contains(&normalize_path(&path.display().to_string()))
|
||||
self.paths
|
||||
.contains(&normalize_path(&path.display().to_string()))
|
||||
}
|
||||
|
||||
fn process_running(&self, process_name: &str) -> bool {
|
||||
self.processes
|
||||
.contains(&process_name.to_ascii_lowercase())
|
||||
self.processes.contains(&process_name.to_ascii_lowercase())
|
||||
}
|
||||
|
||||
fn service_running(&self, service_name: &str) -> bool {
|
||||
self.services
|
||||
.contains(&service_name.to_ascii_lowercase())
|
||||
self.services.contains(&service_name.to_ascii_lowercase())
|
||||
}
|
||||
|
||||
fn registry_install_entries(&self) -> Vec<RegistryInstallEntry> {
|
||||
|
||||
Reference in New Issue
Block a user