def test_clean_console_output(self, dir_function, test_utils, caplog): os.chdir(dir_function['path']) outputdir = helpers.normalize_outputdir() test_utils.create_test_files(outputdir) clean(outputdir, drivers=['firefox=2.5', 'chrome=2.3']) log_record_list = ['{} {}'.format(x.levelname, x.message) for x in caplog.records] assert 'INFO removed chromedriver_2.3' in log_record_list assert 'INFO removed geckodriver_2.5' in log_record_list
def test_clean_multiple_drivers(self, dir_function, test_utils): os.chdir(dir_function['path']) outputdir = helpers.normalize_outputdir() test_utils.create_test_files(outputdir) clean(outputdir, drivers=['chrome=2.2', 'firefox=2.5']) files = os.listdir(outputdir) assert len(files) == 2 assert 'geckodriver_2.6' in files assert 'chromedriver_2.3' in files
def test_clean_only_chrome_windows(self, dir_function, test_utils): os.chdir(dir_function['path']) outputdir = helpers.normalize_outputdir() test_utils.create_test_files_windows(outputdir) clean(outputdir, drivers=['chrome']) files = os.listdir(outputdir) assert len(files) == 2 assert 'geckodriver_2.5.exe' in files assert 'geckodriver_2.6.exe' in files
def test_clean_only_firefox(self, dir_function, test_utils): os.chdir(dir_function['path']) outputdir = helpers.normalize_outputdir() test_utils.create_test_files(outputdir) clean(outputdir, drivers=['firefox']) files = os.listdir(outputdir) assert len(files) == 2 assert 'chromedriver_2.2' in files assert 'chromedriver_2.3' in files
def test_clean_chrome_specific_version(self, dir_function, test_utils): os.chdir(dir_function['path']) outputdir = helpers.normalize_outputdir() test_utils.create_test_files(outputdir) clean(outputdir, drivers=['chrome=2.2']) files = os.listdir(outputdir) assert len(files) == 3 assert 'geckodriver_2.5' in files assert 'geckodriver_2.6' in files assert 'chromedriver_2.3' in files
def test_clean(self, dir_function, test_utils, caplog): os.chdir(dir_function['path']) outputdir = helpers.normalize_outputdir() test_utils.create_test_files(outputdir) clean(outputdir) assert len(os.listdir(outputdir)) == 0