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

Method setUp

tests/hub/test_hub_repository.py:30–44  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28class HubRepositoryTest(unittest.TestCase):
29
30 def setUp(self):
31 self.old_cwd = os.getcwd()
32 self.api = HubApi()
33 self.api.login(TEST_ACCESS_TOKEN1)
34 self.model_name = 'repo-%s' % (uuid.uuid4().hex)
35 self.model_id = '%s/%s' % (TEST_MODEL_ORG, self.model_name)
36 self.revision = 'v0.1_test_revision'
37 self.api.create_model(
38 model_id=self.model_id,
39 visibility=ModelVisibility.PUBLIC,
40 license=Licenses.APACHE_V2,
41 chinese_name=TEST_MODEL_CHINESE_NAME,
42 )
43 temporary_dir = tempfile.mkdtemp()
44 self.model_dir = os.path.join(temporary_dir, self.model_name)
45
46 def tearDown(self):
47 os.chdir(self.old_cwd)

Callers

nothing calls this directly

Calls 2

HubApiClass · 0.90
create_modelMethod · 0.45

Tested by

no test coverage detected