async fn should_enforce_policy_returns_none_on_cooldown() {
        let mut config = Configuration::new().unwrap_or_default();
        config.threads = 50;

        let (handles, _) = setup_requester_test(Some(Arc::new(config))).await;

        let requester = Requester {
            handles,
            seen_links: RwLock::new(HashSet::<String>::new()),
            tuning_lock: Mutex::new(0),
            ferox_scan: Arc::new(FeroxScan::default()),
            target_url: "http://localhost".to_string(),
            rate_limiter: RwLock::new(None),
            policy_data: Default::default(),
        };

        requester
            .policy_data
            .cooling_down
            .store(true, Ordering::Relaxed);

        assert_eq!(requester.should_enforce_policy(), None);
    }
/// should_enforce should early exit when cooldown flag is set
should_enforce should early exit when cooldown flag is set
should_enforce should early exit when cooldown flag is set
async fn should_enforce_policy_returns_none_on_cooldown() {
        let mut config = Configuration::new().unwrap_or_default();
        config.threads = 50;
        let (handles, _) = setup_requester_test(Some(Arc::new(config))).await;
        let requester = Requester {
            handles,
            seen_links: RwLock::new(HashSet::<String>::new()),
            tuning_lock: Mutex::new(0),
            ferox_scan: Arc::new(FeroxScan::default()),
            target_url: "http://localhost".to_string(),
            rate_limiter: RwLock::new(None),
            policy_data: Default::default(),
        };
        requester
            .policy_data
            .cooling_down
            .store(true, Ordering::Relaxed);
        assert_eq!(requester.should_enforce_policy(), None);
    }
async fn should_enforce_policy_returns_none_on_cooldown ( ) { let mut config = Configuration :: new ( ) . unwrap_or_default ( ) ; config . threads = 50 ; let ( handles , _ ) = setup_requester_test ( Some ( Arc :: new ( config ) ) ) . await ; let requester = Requester { handles , seen_links : RwLock :: new ( HashSet :: < String > :: new ( ) ) , tuning_lock : Mutex :: new ( 0 ) , ferox_scan : Arc :: new ( FeroxScan :: default ( ) ) , target_url : " " . to_string ( ) , rate_limiter : RwLock :: new ( None ) , policy_data : Default :: default ( ) , } ; requester . policy_data . cooling_down . store ( true , Ordering :: Relaxed ) ; assert_eq ! ( requester should_enforce_policy ( ) None ) ; }
should_enforce should early exit when cooldown flag is set
should_enforce should early exit when cooldown flag is set