Cloudflare API wrapper using the official cloudflare Python SDK
# Instantiation test: object created without raising when given a mock tokenimport os as _oscf = CF(token='fake-token-for-testing')assert cf._c isnotNoneprint('CF instantiation OK')# Real API calls gated on CF_TEST=1if _os.environ.get('CF_TEST') =='1': cf = CF() # uses CLOUDFLARE_API_TOKEN from env zs = cf.zones() names = [z['name'] for z in zs]print(f'zones: {names}')print('CF.zones() OK')else:print('Skipping real API tests (set CF_TEST=1 to enable)')
CF instantiation OK
Skipping real API tests (set CF_TEST=1 to enable)