MCPcopy Create free account
hub / github.com/modelscope/ms-agent / setUp

Method setUp

tests/utils/test_parse_imports.py:534–558  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

532 """Test that path aliases are resolved correctly"""
533
534 def setUp(self):
535 self.temp_dir = tempfile.mkdtemp()
536 self.src_dir = os.path.join(self.temp_dir, 'src')
537 self.api_dir = os.path.join(self.src_dir, 'api')
538 os.makedirs(self.api_dir)
539
540 self.app_file = os.path.join(self.src_dir, 'App.tsx')
541 Path(self.app_file).touch()
542
543 self.user_file = os.path.join(self.api_dir, 'user.ts')
544 Path(self.user_file).touch()
545
546 # Create tsconfig.json
547 import json
548 tsconfig = {
549 'compilerOptions': {
550 'baseUrl': '.',
551 'paths': {
552 '@api/*': ['src/api/*'],
553 '@/*': ['src/*']
554 }
555 }
556 }
557 with open(os.path.join(self.temp_dir, 'tsconfig.json'), 'w') as f:
558 json.dump(tsconfig, f)
559
560 def tearDown(self):
561 shutil.rmtree(self.temp_dir, ignore_errors=True)

Callers

nothing calls this directly

Calls 1

dumpMethod · 0.80

Tested by

no test coverage detected