Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (29 sloc) 1.06 KB
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at
from os import path
import pytest
def test_execute(axe):
"""Run axe against base_url and verify JSON output."""
data = axe.execute()
assert data is not None, data
def test_report(axe):
"""Test that report exists."""
results = axe.execute()
violations = results["violations"]
report =
assert report is not None, report
def test_write_results(base_url, axe):
"""Assert that write results method creates a non-empty file."""
data = axe.execute()
filename = 'results.json'
axe.write_results(filename, data)
# check that file exists and is not empty
assert path.exists(filename), 'Output file not found.'
assert path.getsize(filename) > 0, 'File contains no data.'