File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
axe_selenium_python/tests Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 33# You can obtain one at http://mozilla.org/MPL/2.0/.
44
55import json
6- from os import getenv , path
6+ from os import getcwd , getenv , path
77
88import pytest
99from selenium import webdriver
@@ -76,3 +76,17 @@ def test_write_results_to_file(tmpdir, mocker):
7676 actual_file_contents = json .loads (f .read ())
7777
7878 assert data == actual_file_contents
79+
80+
81+ def test_write_results_without_filepath (mocker ):
82+ axe = Axe (mocker .MagicMock ())
83+ data = {"testKey" : "testValue" }
84+ cwd = getcwd ()
85+ filename = path .join (cwd , "results.json" )
86+
87+ axe .write_results (data , filename )
88+ with open (filename ) as f :
89+ actual_file_contents = json .loads (f .read ())
90+
91+ assert data == actual_file_contents
92+ assert path .dirname (filename ) == cwd
You can’t perform that action at this time.
0 commit comments