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

Method setUp

tests/hub/test_create_aigc_model.py:20–29  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18class TestCreateAigcModel(unittest.TestCase):
19
20 def setUp(self):
21 self.api = HubApi()
22 self.repo_id: str = f'{TEST_MODEL_ORG}/test_create_aigc_model_{uuid.uuid4().hex[-6:]}'
23
24 # Create a dummy file for AIGC model test
25 self.tmp_file = tempfile.NamedTemporaryFile(
26 suffix='.safetensors', delete=False)
27 self.tmp_file.write(b'This is a dummy weights file for testing.')
28 self.tmp_file.close()
29 self.tmp_file_path = self.tmp_file.name
30
31 def tearDown(self):
32 # Login before cleaning up, ensuring token is valid for deletion.

Callers

nothing calls this directly

Calls 3

HubApiClass · 0.90
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected