Test Tools > General
test_clear_folder(tools_temp_folder)
Confirm that the clear_folder function removes all files and subdirectories from a folder.
Parameters
tools_temp_folder : str Path to a temporary folder provided by the fixture.
Asserts
The folder is empty after the clear_folder function is executed.
Source code in tests/tools/test_general.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
test_download_file(tools_temp_folder)
Verify that the download_file function downloads and saves a file correctly.
Parameters
tools_temp_folder : str Path to a temporary folder provided by the fixture.
Asserts
The file is saved to the specified path with the correct content.
Source code in tests/tools/test_general.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
test_extract_zip(tools_temp_folder)
Verify that the extract_zip function correctly extracts files from a zip archive.
Parameters
tools_temp_folder : str Path to a temporary folder provided by the fixture.
Asserts
The zip archive is extracted to the target directory with all files.
Source code in tests/tools/test_general.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
tools_temp_folder()
Provide a temporary folder for running tests.
Yields
str The path to the temporary folder created for the duration of the module's tests.
Source code in tests/tools/test_general.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|