Skip to content

Commit

Permalink
tests for /api/v1/scan_logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinabraham committed Aug 4, 2024
1 parent 48b2413 commit f0dc1f6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mobsf/StaticAnalyzer/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,21 @@ def api_test():
logger.error('Scan List API Test with custom http header 2')
return True
logger.info('[OK] Scan List API tests completed')
# Scan logs tests
logger.info('Running Scan Logs API tests')
for upl in uploaded:
resp = http_client.post(
'/api/v1/scan_logs',
{'hash': upl['hash']},
HTTP_AUTHORIZATION=auth)
if resp.status_code == 200:
logs = json.loads(resp.content.decode('utf-8'))
if 'logs' in logs and len(logs['logs']) > 0:
logger.info('[OK] Scan Logs API test: %s', upl['hash'])
else:
logger.error('Scan Logs API test: %s', upl['hash'])
return True
logger.info('[OK] Static Analysis API test completed')
# PDF Tests
logger.info('Running PDF Generation API Test')
if platform.system() in ['Darwin', 'Linux']:
Expand Down

0 comments on commit f0dc1f6

Please sign in to comment.