MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / cleanup

Function cleanup

src/Test/conftest.py:109–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107
108
109def cleanup():
110 Db.dbCloseAll()
111 for dir_path in [config.data_dir, config.data_dir + "-temp"]:
112 if os.path.isdir(dir_path):
113 for file_name in os.listdir(dir_path):
114 ext = file_name.rsplit(".", 1)[-1]
115 if ext not in ["csr", "pem", "srl", "db", "json", "tmp"]:
116 continue
117 file_path = dir_path + "/" + file_name
118 if os.path.isfile(file_path):
119 os.unlink(file_path)
120
121atexit.register(cleanup)
122

Callers

nothing calls this directly

Calls 3

deleteFilesMethod · 0.80
deleteSiteMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected