diff --git a/tests/test_project_run.py b/tests/test_project_run.py index 2fe0575..5706a24 100644 --- a/tests/test_project_run.py +++ b/tests/test_project_run.py @@ -8,6 +8,7 @@ from agentstack.conf import ConfigFile from agentstack import frameworks from agentstack.cli import run_project +from agentstack.generation import project_generation BASE_PATH = Path(__file__).parent @@ -17,12 +18,13 @@ class ProjectRunTest(unittest.TestCase): def setUp(self): self.project_dir = BASE_PATH / 'tmp/project_run' / self.framework - os.makedirs(self.project_dir) - os.makedirs(self.project_dir / 'src') - (self.project_dir / 'src' / '__init__.py').touch() - - with open(self.project_dir / 'src' / 'main.py', 'w') as f: - f.write('def run(): pass') + # Generate project using the proper template + project_generation.generate_project( + project_dir=self.project_dir, + framework=self.framework, + project_name="Test Project", + project_slug="test-project" + ) # set the framework in agentstack.json shutil.copy(BASE_PATH / 'fixtures' / 'agentstack.json', self.project_dir / 'agentstack.json') @@ -30,15 +32,6 @@ def setUp(self): with ConfigFile() as config: config.framework = self.framework - # populate the entrypoint - entrypoint_path = frameworks.get_entrypoint_path(self.framework) - print(f"Copying from {BASE_PATH}/fixtures/frameworks/{self.framework}/entrypoint_max.py to {entrypoint_path}") - print(f"Entrypoint path exists before copy: {entrypoint_path.exists()}") - print(f"Source path exists: {(BASE_PATH / f'fixtures/frameworks/{self.framework}/entrypoint_max.py').exists()}") - shutil.copy(BASE_PATH / f"fixtures/frameworks/{self.framework}/entrypoint_max.py", entrypoint_path) - print(f"Entrypoint path exists after copy: {entrypoint_path.exists()}") - if entrypoint_path.exists(): - print(f"Entrypoint content:\n{entrypoint_path.read_text()}") # write a basic .env file shutil.copy(BASE_PATH / 'fixtures' / '.env', self.project_dir / '.env')