@@ -87,3 +87,89 @@ async def test_successful_guide_fetch(self, temp_directories, tmp_path, monkeypa
8787 assert 'Placeholder content just to verify the tool can fetch the file.' in result
8888 assert temp_directories ['iac' ] in result
8989 assert temp_directories ['app' ] in result
90+
91+ @pytest .mark .asyncio
92+ async def test_case_normalization (self , temp_directories ):
93+ """Test that platform and language are normalized to lowercase."""
94+ result = await get_enablement_guide (
95+ platform = 'EC2' ,
96+ language = 'PYTHON' ,
97+ iac_directory = temp_directories ['iac' ],
98+ app_directory = temp_directories ['app' ],
99+ )
100+
101+ assert '# Application Signals Enablement Guide' in result
102+
103+ @pytest .mark .asyncio
104+ async def test_whitespace_trimming (self , temp_directories ):
105+ """Test that whitespace is trimmed from inputs."""
106+ result = await get_enablement_guide (
107+ platform = ' ec2 ' ,
108+ language = ' python ' ,
109+ iac_directory = temp_directories ['iac' ],
110+ app_directory = temp_directories ['app' ],
111+ )
112+
113+ assert '# Application Signals Enablement Guide' in result
114+
115+ @pytest .mark .asyncio
116+ async def test_all_valid_platforms (self , temp_directories ):
117+ """Test that all valid platforms are accepted."""
118+ valid_platforms = ['ec2' , 'ecs' , 'lambda' , 'eks' ]
119+
120+ for platform in valid_platforms :
121+ result = await get_enablement_guide (
122+ platform = platform ,
123+ language = 'python' ,
124+ iac_directory = temp_directories ['iac' ],
125+ app_directory = temp_directories ['app' ],
126+ )
127+
128+ assert 'Error: Invalid platform' not in result
129+
130+ @pytest .mark .asyncio
131+ async def test_all_valid_languages (self , temp_directories ):
132+ """Test that all valid languages are accepted."""
133+ valid_languages = ['python' , 'nodejs' , 'java' , 'dotnet' ]
134+
135+ for language in valid_languages :
136+ result = await get_enablement_guide (
137+ platform = 'ec2' ,
138+ language = language ,
139+ iac_directory = temp_directories ['iac' ],
140+ app_directory = temp_directories ['app' ],
141+ )
142+
143+ assert 'Error: Invalid language' not in result
144+
145+ @pytest .mark .asyncio
146+ async def test_relative_path_resolution (self , temp_directories , monkeypatch ):
147+ """Test that relative paths are resolved correctly."""
148+ import os
149+
150+ base_dir = Path (temp_directories ['iac' ]).parent .parent
151+ monkeypatch .chdir (base_dir )
152+
153+ result = await get_enablement_guide (
154+ platform = 'ec2' ,
155+ language = 'python' ,
156+ iac_directory = 'infrastructure/cdk' ,
157+ app_directory = 'app/src' ,
158+ )
159+
160+ assert '# Application Signals Enablement Guide' in result
161+ assert str (base_dir ) in result
162+
163+ @pytest .mark .asyncio
164+ async def test_absolute_path_handling (self , temp_directories ):
165+ """Test that absolute paths are handled correctly."""
166+ result = await get_enablement_guide (
167+ platform = 'ec2' ,
168+ language = 'python' ,
169+ iac_directory = temp_directories ['iac' ],
170+ app_directory = temp_directories ['app' ],
171+ )
172+
173+ assert '# Application Signals Enablement Guide' in result
174+ assert temp_directories ['iac' ] in result
175+ assert temp_directories ['app' ] in result
0 commit comments