async fn too_many_status_errors_returns_correct_values() {
        let (handles, _) = setup_requester_test(None).await;

        let mut 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: PolicyData::new(RequesterPolicy::AutoBail, 7),
        };

        assert!(!requester.too_many_status_errors(PolicyTrigger::Errors));

        assert!(!requester.too_many_status_errors(PolicyTrigger::Status429));
        requester.ferox_scan.progress_bar().set_position(10);
        requester.ferox_scan.add_429();
        requester.ferox_scan.add_429();
        requester.ferox_scan.add_429();
        assert!(requester.too_many_status_errors(PolicyTrigger::Status429));

        assert!(!requester.too_many_status_errors(PolicyTrigger::Status403));
        requester.ferox_scan = Arc::new(FeroxScan::default());
        requester.ferox_scan.progress_bar().set_position(10);
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        assert!(requester.too_many_status_errors(PolicyTrigger::Status403));
    }
/// errors policytrigger should always be false, 403 is high ratio, and 429 is high ratio / 3
errors policytrigger should always be false, 403 is high ratio, and 429 is high ratio / 3
errors policytrigger should always be false 403 is high ratio and 429 is high ratio / 3
async fn too_many_status_errors_returns_correct_values() {
        let (handles, _) = setup_requester_test(None).await;
        let mut 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: PolicyData::new(RequesterPolicy::AutoBail, 7),
        };
        assert!(!requester.too_many_status_errors(PolicyTrigger::Errors));
        assert!(!requester.too_many_status_errors(PolicyTrigger::Status429));
        requester.ferox_scan.progress_bar().set_position(10);
        requester.ferox_scan.add_429();
        requester.ferox_scan.add_429();
        requester.ferox_scan.add_429();
        assert!(requester.too_many_status_errors(PolicyTrigger::Status429));
        assert!(!requester.too_many_status_errors(PolicyTrigger::Status403));
        requester.ferox_scan = Arc::new(FeroxScan::default());
        requester.ferox_scan.progress_bar().set_position(10);
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        requester.ferox_scan.add_403();
        assert!(requester.too_many_status_errors(PolicyTrigger::Status403));
    }
async fn too_many_status_errors_returns_correct_values ( ) { let ( handles , _ ) = setup_requester_test ( None ) . await ; let mut 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 : PolicyData :: new ( RequesterPolicy :: AutoBail , 7 ) , } ; assert ! ( requester too_many_status_errors ( PolicyTrigger Errors ) ) ; assert ! ( requester too_many_status_errors ( PolicyTrigger Status429 ) ) ; requester . ferox_scan . progress_bar ( ) . set_position ( 10 ) ; requester . ferox_scan . add_429 ( ) ; requester . ferox_scan . add_429 ( ) ; requester . ferox_scan . add_429 ( ) ; assert ! ( requester too_many_status_errors ( PolicyTrigger Status429 ) ) ; assert ! ( requester too_many_status_errors ( PolicyTrigger Status403 ) ) ; requester . ferox_scan = Arc :: new ( FeroxScan :: default ( ) ) ; requester . ferox_scan . progress_bar ( ) . set_position ( 10 ) ; requester . ferox_scan . add_403 ( ) ; requester . ferox_scan . add_403 ( ) ; requester . ferox_scan . add_403 ( ) ; requester . ferox_scan . add_403 ( ) ; requester . ferox_scan . add_403 ( ) ; requester . ferox_scan . add_403 ( ) ; requester . ferox_scan . add_403 ( ) ; requester . ferox_scan . add_403 ( ) ; requester . ferox_scan . add_403 ( ) ; assert ! ( requester too_many_status_errors ( PolicyTrigger Status403 ) ) ; }
errors policytrigger should always be false, 403 is high ratio, and 429 is high ratio / 3
errors policytrigger should always be false 403 is high ratio and 429 is high ratio / 3