@@ -12,7 +12,7 @@ class TestGenerateAgentMdFile:
1212 """Tests for the generate_agent_md_file function."""
1313
1414 def test_generate_file_success (self ):
15- """Test successfully generating an agent MD file."""
15+ """Test successfully generating AGENTS.md file."""
1616 with tempfile .TemporaryDirectory () as temp_dir :
1717 result = generate_agent_md_file (
1818 temp_dir , "AGENTS.md" , "uipath_langchain._resources" , False
@@ -27,7 +27,7 @@ def test_generate_file_success(self):
2727 with open (target_path , "r" ) as f :
2828 content = f .read ()
2929 assert len (content ) > 0
30- assert "Agent Code Patterns Reference " in content
30+ assert "LangGraph " in content
3131
3232 def test_file_already_exists (self ):
3333 """Test that an existing file is overwritten."""
@@ -49,26 +49,7 @@ def test_file_already_exists(self):
4949 content = f .read ()
5050
5151 assert content != original_content
52- assert "Agent Code Patterns Reference" in content
53-
54- def test_generate_required_structure_file (self ):
55- """Test generating REQUIRED_STRUCTURE.md file."""
56- with tempfile .TemporaryDirectory () as temp_dir :
57- agent_dir = os .path .join (temp_dir , ".agent" )
58- os .makedirs (agent_dir , exist_ok = True )
59- result = generate_agent_md_file (
60- agent_dir , "REQUIRED_STRUCTURE.md" , "uipath_langchain._resources" , False
61- )
62- assert result is not None
63- file_name , status = result
64- assert file_name == "REQUIRED_STRUCTURE.md"
65- assert status == FileOperationStatus .CREATED
66-
67- target_path = os .path .join (agent_dir , "REQUIRED_STRUCTURE.md" )
68- assert os .path .exists (target_path )
69- with open (target_path , "r" ) as f :
70- content = f .read ()
71- assert "Required Agent Structure" in content
52+ assert "LangGraph" in content
7253
7354 def test_file_skipped_when_no_override (self ):
7455 """Test that an existing file is skipped when no_agents_md_override is True."""
@@ -95,54 +76,33 @@ def test_file_skipped_when_no_override(self):
9576class TestGenerateSpecificAgentsMdFiles :
9677 """Tests for the generate_specific_agents_md_files function."""
9778
98- def test_generate_all_files (self ):
99- """Test that all agent documentation files are generated."""
79+ def test_generate_agents_and_claude_md (self ):
80+ """Test that AGENTS.md and CLAUDE.md are generated (without .agent/ sub-docs) ."""
10081 with tempfile .TemporaryDirectory () as temp_dir :
10182 results = list (generate_specific_agents_md_files (temp_dir , False ))
10283
103- # Check that we got results for all files
104- assert len (results ) == 5
84+ # Check that we got results for AGENTS.md and CLAUDE.md
85+ assert len (results ) == 2
10586 file_names = [name for name , _ in results ]
10687 assert "AGENTS.md" in file_names
107- assert "REQUIRED_STRUCTURE.md" in file_names
10888 assert "CLAUDE.md" in file_names
109- assert "CLI_REFERENCE.md" in file_names
110- assert "SDK_REFERENCE.md" in file_names
11189
112- # Check all were created (not updated or skipped)
90+ # Should NOT create .agent directory
91+ assert not os .path .exists (os .path .join (temp_dir , ".agent" ))
92+
93+ # Check files were created (not updated or skipped)
11394 for _ , status in results :
11495 assert status == FileOperationStatus .CREATED
11596
116- agent_dir = os .path .join (temp_dir , ".agent" )
117- assert os .path .exists (agent_dir )
118- assert os .path .isdir (agent_dir )
119-
12097 agents_md_path = os .path .join (temp_dir , "AGENTS.md" )
12198 assert os .path .exists (agents_md_path )
12299
123- required_structure_path = os .path .join (agent_dir , "REQUIRED_STRUCTURE.md" )
124- assert os .path .exists (required_structure_path )
125-
126100 with open (agents_md_path , "r" ) as f :
127101 agents_content = f .read ()
128- assert "Agent Code Patterns Reference" in agents_content
129-
130- with open (required_structure_path , "r" ) as f :
131- required_content = f .read ()
132- assert "Required Agent Structure" in required_content
133-
134- def test_agent_dir_already_exists (self ):
135- """Test that the existing .agent directory doesn't cause errors."""
136- with tempfile .TemporaryDirectory () as temp_dir :
137- agent_dir = os .path .join (temp_dir , ".agent" )
138- os .makedirs (agent_dir , exist_ok = True )
139-
140- results = list (generate_specific_agents_md_files (temp_dir , False ))
141- assert len (results ) == 5
142- assert os .path .exists (agent_dir )
102+ assert "LangGraph" in agents_content
143103
144104 def test_files_overwritten (self ):
145- """Test that existing files are overwritten."""
105+ """Test that existing AGENTS.md is overwritten."""
146106 with tempfile .TemporaryDirectory () as temp_dir :
147107 agents_md_path = os .path .join (temp_dir , "AGENTS.md" )
148108 original_content = "Custom documentation"
@@ -151,7 +111,7 @@ def test_files_overwritten(self):
151111
152112 results = list (generate_specific_agents_md_files (temp_dir , False ))
153113
154- # Check that AGENTS.md was updated, others were created
114+ # Check that AGENTS.md was updated
155115 agents_result = [r for r in results if r [0 ] == "AGENTS.md" ]
156116 assert len (agents_result ) == 1
157117 _ , status = agents_result [0 ]
@@ -161,42 +121,26 @@ def test_files_overwritten(self):
161121 content = f .read ()
162122
163123 assert content != original_content
164- assert "Agent Code Patterns Reference " in content
124+ assert "LangGraph " in content
165125
166126 def test_files_skipped_when_no_override (self ):
167- """Test that existing files are skipped when no_agents_md_override is True."""
127+ """Test that existing AGENTS.md is skipped when no_agents_md_override is True."""
168128 with tempfile .TemporaryDirectory () as temp_dir :
169- # Create some existing files
129+ # Create existing AGENTS.md
170130 agents_md_path = os .path .join (temp_dir , "AGENTS.md" )
171- claude_md_path = os .path .join (temp_dir , "CLAUDE.md" )
172131 with open (agents_md_path , "w" ) as f :
173132 f .write ("Existing AGENTS.md" )
174- with open (claude_md_path , "w" ) as f :
175- f .write ("Existing CLAUDE.md" )
176133
177134 results = list (generate_specific_agents_md_files (temp_dir , True ))
178135
179- # Check that existing files were skipped
136+ # Check that existing file was skipped
180137 skipped_files = [
181138 name
182139 for name , status in results
183140 if status == FileOperationStatus .SKIPPED
184141 ]
185142 assert "AGENTS.md" in skipped_files
186- assert "CLAUDE.md" in skipped_files
187-
188- # Check that non-existing files were created
189- created_files = [
190- name
191- for name , status in results
192- if status == FileOperationStatus .CREATED
193- ]
194- assert "CLI_REFERENCE.md" in created_files
195- assert "SDK_REFERENCE.md" in created_files
196- assert "REQUIRED_STRUCTURE.md" in created_files
197143
198- # Verify the existing files were not modified
144+ # Verify the existing file was not modified
199145 with open (agents_md_path , "r" ) as f :
200146 assert f .read () == "Existing AGENTS.md"
201- with open (claude_md_path , "r" ) as f :
202- assert f .read () == "Existing CLAUDE.md"
0 commit comments