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

Method prepare_case

tests/cli/test_download_cmd.py:44–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

42 self.prepare_case()
43
44 def prepare_case(self):
45 temporary_dir = tempfile.mkdtemp()
46 self.model_dir = os.path.join(temporary_dir, self.model_name)
47 repo = Repository(self.model_dir, clone_from=self.model_id)
48 os.system("echo 'testtest'>%s"
49 % os.path.join(self.model_dir, download_model_file_name))
50 repo.push('add model')
51 repo.tag_and_push(self.revision, 'Test revision')
52
53 def tearDown(self):
54 shutil.rmtree(self.tmp_dir)

Callers 1

setUpMethod · 0.95

Calls 3

pushMethod · 0.95
tag_and_pushMethod · 0.95
RepositoryClass · 0.90

Tested by

no test coverage detected