MCPcopy Create free account
hub / github.com/modelscope/modelscope / tearDown

Method tearDown

tests/hub/test_upload_file_folder.py:47–62  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

45 self._construct_file()
46
47 def tearDown(self):
48
49 # Remove repositories
50 try:
51 self.api.delete_repo(
52 repo_id=self.repo_id_model, repo_type=REPO_TYPE_MODEL)
53 self.api.delete_repo(
54 repo_id=self.repo_id_dataset, repo_type=REPO_TYPE_DATASET)
55 except Exception as e:
56 logger.warning(f'Failed to delete repo: {e}')
57
58 # Clean up the temporary credentials
59 delete_credential()
60
61 # Clean up the temporary directory
62 shutil.rmtree(self.work_dir)
63
64 def _construct_file(self):
65

Callers

nothing calls this directly

Calls 1

delete_credentialFunction · 0.90

Tested by

no test coverage detected