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

Method prepare_case

tests/hub/test_hub_operation.py:50–57  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48 logger.warning(f'delete model {self.model_id} failed, {e}')
49
50 def prepare_case(self):
51 temporary_dir = tempfile.mkdtemp()
52 self.model_dir = os.path.join(temporary_dir, self.model_name)
53 repo = Repository(self.model_dir, clone_from=self.model_id)
54 os.system("echo 'testtest'>%s"
55 % os.path.join(self.model_dir, download_model_file_name))
56 repo.push('add model')
57 repo.tag_and_push(self.revision, 'Test revision')
58
59 def test_model_repo_creation(self):
60 # change to proper model names before use.

Calls 3

pushMethod · 0.95
tag_and_pushMethod · 0.95
RepositoryClass · 0.90

Tested by

no test coverage detected