Skip to content

Commit

Permalink
more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Dec 26, 2023
1 parent 945afcc commit a42d836
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test_radar_returning_csv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
""" radar returning CSV test """

import os
import sys
import uuid

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

# test radar - this tests CSV responses

cf = None

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

def test_radar_datasets_ranking_top_200():
results = cf.radar.datasets('ranking_top_200')
assert len(results) > 0
lines = results.splitlines()
assert lines[0] == 'domain'
assert len(lines) >= 200+1

def test_radar_datasets_ranking_top_1000():
results = cf.radar.datasets('ranking_top_1000')
assert len(results) > 0
lines = results.splitlines()
assert lines[0] == 'domain'
assert len(lines) >= 1000+1

0 comments on commit a42d836

Please sign in to comment.