|
6 | 6 | # Addding the python tool |
7 | 7 | sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) |
8 | 8 |
|
9 | | -from Easy_versioning.main import initial_setup, final_cleaning, check_default_language, get_versions |
| 9 | +from Easy_versioning.main import initial_setup, final_cleaning, check_default_language, get_versions, initial_set_up |
10 | 10 |
|
11 | 11 | # Utils functions |
12 | 12 | def success(message): |
@@ -99,6 +99,30 @@ def test_get_versions(): |
99 | 99 | success("get_versions working as expected") |
100 | 100 | assert True |
101 | 101 |
|
| 102 | +def test_initial_set_up(): |
| 103 | + info("Running initial_set_up test") |
| 104 | + |
| 105 | + # Cleaning the folders |
| 106 | + for folder in ["src", "data"]: |
| 107 | + if os.path.exists(folder): |
| 108 | + shutil.rmtree(folder, onerror=handle_remove_readonly) |
| 109 | + |
| 110 | + # Calling the initial_set_up function |
| 111 | + initial_set_up() |
| 112 | + |
| 113 | + # Checking the main folders |
| 114 | + assert os.path.exists("src"), "initial_set_up: 'src' not created" |
| 115 | + assert os.path.exists("data"), "initial_set_up: 'data' not created" |
| 116 | + |
| 117 | + # Checking the versions |
| 118 | + expected_versions = ["V. 1.0", "V. 2.0"] |
| 119 | + for version in expected_versions: |
| 120 | + version_path = os.path.join("src", version) |
| 121 | + assert os.path.exists(version_path), f"initial_set_up: version folder '{version}' not created" |
| 122 | + |
| 123 | + success("initial_set_up working as expected") |
| 124 | + |
| 125 | + |
102 | 126 | # Using the tests function before an official new version of the tool |
103 | 127 | if __name__ == "__main__": |
104 | 128 |
|
|
0 commit comments