Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added count to crud_fns and macro #11

Merged
merged 2 commits into from
Jun 1, 2024
Merged

Conversation

eboody
Copy link
Contributor

@eboody eboody commented May 31, 2024

added count to base

	async fn test_count_ok() -> Result<()> {
		// -- Setup & Fixtures
		let mm = _dev_utils::init_test().await;
		let ctx = Ctx::root_ctx();

		let fx_agent_names = &["test_list_ok agent 01", "test_list_ok agent 02"];
		seed_agents(&ctx, &mm, fx_agent_names).await?;

		// -- Exec
		let agent_filter: AgentFilter = serde_json::from_value(json!(
			{
				"name": {"$contains": "list_ok agent"}
			}
		))?;
		let count = AgentBmc::count(&ctx, &mm, Some(vec![agent_filter])).await?;

		// -- Check
		assert_eq!(count, 2);

		// -- Clean
		let count = clean_agents(&ctx, &mm, "test_list_ok agent").await?;
		assert_eq!(count, 2, "Should have cleaned 2 agents");

		Ok(())
	}

@jeremychone jeremychone merged commit b47969b into rust10x:main Jun 1, 2024
@eboody eboody deleted the add_count branch June 1, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants