def setUp(self): try: shutil.rmtree(_TEST_WORKING) except: pass try: shutil.rmtree(_TEST_CLOUD) except: pass try: shutil.rmtree(_TEST_TMP) except: pass if not os.path.exists(_TEST_TMP_BASE_DIR): os.makedirs(_TEST_TMP_BASE_DIR) os.makedirs(_TEST_TMP) if os.path.exists(_TEST_FI_CSV): os.remove(_TEST_FI_CSV) shutil.copytree(os.path.join(_TEST_CASES_BASE_DIR, "working"), _TEST_WORKING) os.makedirs(_TEST_CLOUD) self.under_test = main.BoxWrap(_TEST_WORKING, _TEST_CLOUD, _TEST_TMP, _TEST_FI_CSV, password="******") has_changes, self.working_di, self.cloud_di = self.under_test.sync(file_info.empty_dir_info(".")) # Clean up tmp for initial sync try: shutil.rmtree(_TEST_TMP) except: pass os.makedirs(_TEST_TMP)