def test_find_artifacts_on_disk_art_location_6(data_folder): """ This test verifies that with artifact locations we check the location and walk the results directory looking for a specific subdirectory. The regex generated will only match payload_eg """ art_location = ['artifacts/localhosts/payload_eg/', 'artifacts/localhosts/payload_eg/results', 'artifacts/localhosts/payload_eg/results/junit_example.xml'] assert len(find_artifacts_on_disk(data_folder, 'payload_eg/', art_location)) == 1
def test_find_artifacts_on_disk_art_location_4(data_folder): """ This test verifies that with artifact locations we check the location and walk the results directory looking for a file that doesn't exist. """ art_location = ['artifacts/localhosts/payload_eg/', 'artifacts/localhosts/payload_eg/results', 'artifacts/localhosts/payload_eg/results/junit_example.xml'] assert len(find_artifacts_on_disk(data_folder, 'hello.xml', art_location)) == 0
def test_find_artifacts_on_disk_art_location_2(data_folder): """ This test verifies that with artifact locations we check the location and walk the results directory looking for all files using a pattern. """ art_location = ['artifacts/localhosts/payload_eg/', 'artifacts/localhosts/payload_eg/results', 'artifacts/localhosts/payload_eg/results/junit_example.xml'] assert len(find_artifacts_on_disk(data_folder, '*.xml', art_location)) == 3
def test_find_artifacts_on_disk_art_location_5(data_folder): """ This test verifies that with artifact locations we check the location and walk the results directory looking for a files using * within a specific subdirectory. The regex generated will match all three items in art_locations dictionary. """ art_location = ['artifacts/localhosts/payload_eg/', 'artifacts/localhosts/payload_eg/results', ' artifacts/localhosts/payload_eg/results/junit_example.xml'] assert len(find_artifacts_on_disk(data_folder, 'payload_eg/*', art_location)) == 3
def test_find_artifacts_on_disk_art_location_7(data_folder): """ This test verifies that with artifact locations we check the location and walk the results directory looking for a specific file that is in results directory but the results directory was also specified in the art_locations. """ art_location = ['artifacts/localhosts/payload_eg/', 'artifacts/localhosts/payload_eg/results', 'artifacts/localhosts/payload_eg/results/junit_example.xml', 'junit2.xml'] assert len(find_artifacts_on_disk(data_folder, 'junit2.xml', art_location)) == 1
def test_find_artifacts_on_disk_no_art_location_3(data_folder): """ This test verifies that no artifact locations is given we walk the results looking for specific files in a subdirectory of results folder. """ assert len(find_artifacts_on_disk(data_folder, 'payload_eg/*')) == 1
def test_find_artifacts_on_disk_no_art_location_2(data_folder): """ This test verifies that no artifact locations is given we walk the results looking for specific xml file. """ assert len(find_artifacts_on_disk(data_folder, 'junit2.xml')) == 1
def test_find_artifacts_on_disk_no_art_location_1(data_folder): """ This test verifies that no artifact locations is given we walk the results looking for all xml files. """ assert len(find_artifacts_on_disk(data_folder, '*xml')) == 3