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

Method setUp

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

Source from the content-addressed store, hash-verified

23class DownloadCMDTest(unittest.TestCase):
24
25 def setUp(self):
26 print(('Testing %s.%s' % (type(self).__name__, self._testMethodName)))
27 self.tmp_dir = tempfile.TemporaryDirectory().name
28 if not os.path.exists(self.tmp_dir):
29 os.makedirs(self.tmp_dir)
30
31 self.api = HubApi()
32 self.api.login(TEST_ACCESS_TOKEN1)
33 self.model_name = 'op-%s' % (uuid.uuid4().hex)
34 self.model_id = '%s/%s' % (TEST_MODEL_ORG, self.model_name)
35 self.revision = 'v0.1_test_revision'
36 self.api.create_model(
37 model_id=self.model_id,
38 visibility=ModelVisibility.PUBLIC,
39 license=Licenses.APACHE_V2,
40 chinese_name=TEST_MODEL_CHINESE_NAME,
41 )
42 self.prepare_case()
43
44 def prepare_case(self):
45 temporary_dir = tempfile.mkdtemp()

Callers

nothing calls this directly

Calls 5

prepare_caseMethod · 0.95
HubApiClass · 0.90
printFunction · 0.85
existsMethod · 0.45
create_modelMethod · 0.45

Tested by

no test coverage detected