403Webshell
Server IP : 202.155.9.250  /  Your IP : 216.73.217.177
Web Server : LiteSpeed
System : Linux srv339029361 5.15.0-177-generic #187-Ubuntu SMP Sat Apr 11 22:54:33 UTC 2026 x86_64
User : grabn6394 ( 1016)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/CyberPanel/lib/python3.10/site-packages/CloudFlare/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/CyberPanel/lib/python3.10/site-packages/CloudFlare/tests/test_find.py
""" find api tests """

import os
import sys

sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
import CloudFlare

# test API list fetches from Cloudflare website

cf = None

def test_cloudflare(debug=False):
    """ test_cloudflare """
    global cf
    cf = CloudFlare.CloudFlare(debug=debug)
    assert isinstance(cf, CloudFlare.CloudFlare)

def test_find():
    """ test_find """
    ips_call = cf.find('/ips')
    assert True

def test_find_call():
    """ test_find """
    ips_call = cf.find('/ips')
    ips = ips_call()
    assert isinstance(ips, dict)
    assert isinstance(ips['ipv4_cidrs'], list)
    assert isinstance(ips['ipv6_cidrs'], list)
    assert len(ips['ipv4_cidrs']) > 0
    assert len(ips['ipv6_cidrs']) > 0

def test_find_invalid():
    """ test_find """
    try:
        invalid_endpoint_call = cf.find('/invalid-endpoint')
        print('error - should not reach here', file=sys.stderr)
        assert False
    except AttributeError as e:
        assert True

if __name__ == '__main__':
    test_cloudflare(debug=True)
    test_find()
    test_find_call()
    test_find_invalid()

Youez - 2016 - github.com/yon3zu
LinuXploit