@@ -56,7 +56,7 @@ def test_config_imports(self):
5656 def test_vision_components (self ):
5757 """Test vision components can be imported."""
5858 try :
59- from layoutlens . vision import Capture , VisionAnalyzer
59+ from layoutlens import Capture , VisionAnalyzer
6060
6161 self .assertTrue (True , "Vision components imported successfully" )
6262 except ImportError as e :
@@ -107,7 +107,7 @@ def test_url_detection(self):
107107
108108 @pytest .mark .asyncio
109109 @patch ("layoutlens.api.core.acompletion" )
110- @patch ("layoutlens.vision. capture.Capture.screenshots" )
110+ @patch ("layoutlens.capture.Capture.screenshots" )
111111 async def test_analyze_url_flow (self , mock_capture , mock_acompletion ):
112112 """Test the full analyze URL workflow."""
113113 from layoutlens .api .core import LayoutLens
@@ -159,7 +159,7 @@ async def test_analyze_screenshot_flow(self):
159159 with self .assertRaises (LayoutFileNotFoundError ):
160160 await lens .analyze ("/nonexistent/file.png" , "Test query" )
161161
162- @patch ("layoutlens.vision. analyzer.openai.OpenAI" )
162+ @patch ("layoutlens.analyzer.openai.OpenAI" )
163163 @pytest .mark .asyncio
164164 async def test_compare_method (self , mock_openai ):
165165 """Test the compare method functionality."""
@@ -216,18 +216,18 @@ class TestVisionComponents(unittest.TestCase):
216216 def setUp (self ):
217217 self .mock_api_key = "sk-test-key-12345"
218218
219- @patch ("layoutlens.vision. analyzer.openai.OpenAI" )
219+ @patch ("layoutlens.analyzer.openai.OpenAI" )
220220 def test_vision_analyzer_initialization (self , mock_openai ):
221221 """Test VisionAnalyzer initialization."""
222- from layoutlens .vision . analyzer import VisionAnalyzer
222+ from layoutlens .analyzer import VisionAnalyzer
223223
224224 analyzer = VisionAnalyzer (api_key = self .mock_api_key )
225225 self .assertEqual (analyzer .model , "gpt-4o-mini" )
226226
227227 def test_url_capture_viewports (self ):
228228 """Test Capture viewport configurations."""
229+ from layoutlens .capture import Capture
229230 from layoutlens .config import ViewportConfig
230- from layoutlens .vision .capture import Capture
231231
232232 capture = Capture ()
233233
@@ -260,7 +260,8 @@ def test_layout_comparator(self):
260260 # LayoutComparator functionality is now integrated into LayoutLens.compare()
261261 # This test verifies the old separate class is no longer available
262262 with self .assertRaises (ImportError ):
263- from layoutlens .vision .comparator import LayoutComparator
263+ # LayoutComparator was removed in favor of direct API methods
264+ from layoutlens .comparator import LayoutComparator
264265
265266
266267class TestGitHubIntegration (unittest .TestCase ):
@@ -282,9 +283,8 @@ def test_required_files_exist(self):
282283 required_files = [
283284 "layoutlens/api/__init__.py" ,
284285 "layoutlens/api/core.py" ,
285- "layoutlens/vision/__init__.py" ,
286- "layoutlens/vision/analyzer.py" ,
287- "layoutlens/vision/capture.py" ,
286+ "layoutlens/analyzer.py" ,
287+ "layoutlens/capture.py" ,
288288 ]
289289
290290 for file_path in required_files :
@@ -310,8 +310,8 @@ def test_python_files_syntax(self):
310310 """Test that all Python files have valid syntax."""
311311 python_files = [
312312 "layoutlens/api/core.py" ,
313- "layoutlens/vision/ analyzer.py" ,
314- "layoutlens/vision/ capture.py" ,
313+ "layoutlens/analyzer.py" ,
314+ "layoutlens/capture.py" ,
315315 ]
316316
317317 for file_path in python_files :
@@ -364,8 +364,8 @@ def test_missing_dependencies_handling(self):
364364 # This test verifies the dependencies are properly declared.
365365
366366 try :
367- from layoutlens .vision . analyzer import VisionAnalyzer
368- from layoutlens .vision . capture import Capture
367+ from layoutlens .analyzer import VisionAnalyzer
368+ from layoutlens .capture import Capture
369369
370370 # If we can import these, dependencies are available
371371 self .assertTrue (True , "Core dependencies are available" )
0 commit comments