Skip to content

Commit e78ad8a

Browse files
committed
small fixes
1 parent d6dc180 commit e78ad8a

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/models/agents/agent_backend.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ impl SpecialFunctions for AgentBackendDeveloper {
138138
&self.attributes
139139
}
140140

141-
async fn execute(
142-
&mut self,
143-
fact_sheet: &mut FactSheet,
144-
) -> Result<(), Box<dyn std::error::Error>> {
141+
async fn execute(&mut self, fact_sheet: &mut FactSheet ) -> Result<(), Box<dyn std::error::Error>> {
145142
while self.attributes.state != AgentState::Finished {
146143
match &self.attributes.state {
147144
AgentState::Discovery => {
@@ -173,7 +170,7 @@ impl SpecialFunctions for AgentBackendDeveloper {
173170

174171
// Build and testing code
175172
PrintCommand::UnitTest.print_agent_message(
176-
&self.attributes.position.as_str(), "Backend Code Unit Testing: building web server...");
173+
&self.attributes.position.as_str(), "Backend Code Unit Testing: Building web server...");
177174

178175
let build_backend_server: std::process::Output = Command::new("cargo")
179176
.arg("build")
@@ -219,9 +216,7 @@ impl SpecialFunctions for AgentBackendDeveloper {
219216

220217
// define endpoints checks. Выбрать в итераторе только проверяемые ендпоинты
221218
let check_endpoints: Vec<RouteObject> = api_endpoints.iter()
222-
.filter(|&route_object: &RouteObject| {
223-
route_object.method == "get" && route_object.is_route_dynamic == "false"
224-
})
219+
.filter(|&route_object| { route_object.method == "get" && route_object.is_route_dynamic == "false" })
225220
.cloned().collect();
226221

227222
// Store API endpoints
@@ -260,7 +255,7 @@ impl SpecialFunctions for AgentBackendDeveloper {
260255
.build().unwrap();
261256

262257
// test url
263-
let url: String = format!("http://localhos:8080{}", endpoint.route);
258+
let url: String = format!("http://127.0.0.1:8080{}", endpoint.route);
264259
match check_status_code(&client, &url).await {
265260
Ok(status_code) => {
266261
if status_code != 200 {
@@ -280,7 +275,7 @@ impl SpecialFunctions for AgentBackendDeveloper {
280275
}
281276

282277
save_api_endpoints(&api_endpoints_str);
283-
PrintCommand::Issue.print_agent_message(
278+
PrintCommand::Success.print_agent_message(
284279
&self.attributes.position.as_str(), "Backend Testing completed...");
285280

286281
run_backend_server.kill().expect("failed to Kill server on completion");
@@ -319,7 +314,8 @@ mod tests {
319314

320315
let mut factsheet: FactSheet = serde_json::from_str(factsheet_str).unwrap();
321316

322-
agent.attributes.state = AgentState::Discovery;
317+
// agent.attributes.state = AgentState::Discovery;
318+
agent.attributes.state = AgentState::UnitTesting;
323319
agent
324320
.execute(&mut factsheet)
325321
.await

0 commit comments

Comments
 (0)