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

Add pytest for YouTube agent #3

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Add pytest for YouTube agent #3

wants to merge 16 commits into from

Conversation

gagb
Copy link
Owner

@gagb gagb commented Dec 13, 2024

Add pytests, GitHub workflow, and pre-commit hooks for the YouTube agent package.

  • Pytests:

    • Add tests/test_youtube_agent.py to check if the agent returns 'autogen' for the video https://www.youtube.com/watch?v=KuX_dkqr7UY.
    • Mock the OpenAIChatCompletionClient to return a predefined response.
    • Use pytest fixtures to set up the YouTubeAgent.
    • Initiate the team just like in example.py but use run instead of run_stream.
    • Verify the TaskResult object contains the expected messages.
  • GitHub Workflow:

    • Add .github/workflows/test.yml to run tests on push and pull requests.
    • Use actions/setup-python to set up Python 3.10.
    • Install dependencies and run pytest.
  • Pre-commit Hooks:

    • Add pre-commit-config.yaml with configuration for black formatter.
    • Add pre-commit hook to run black on all Python files.
    • Update pyproject.toml to include black formatter configuration and add black to the list of dependencies.

gagb added 16 commits December 12, 2024 16:06
Add pytests, GitHub workflow, and pre-commit hooks for the YouTube agent package.

* **Pytests**:
  - Add `tests/test_youtube_agent.py` to check if the agent returns 'autogen' for the video https://www.youtube.com/watch?v=KuX_dkqr7UY.
  - Mock the OpenAIChatCompletionClient to return a predefined response.
  - Use pytest fixtures to set up the YouTubeAgent.
  - Initiate the team just like in `example.py` but use `run` instead of `run_stream`.
  - Verify the TaskResult object contains the expected messages.

* **GitHub Workflow**:
  - Add `.github/workflows/test.yml` to run tests on push and pull requests.
  - Use actions/setup-python to set up Python 3.10.
  - Install dependencies and run pytest.

* **Pre-commit Hooks**:
  - Add `pre-commit-config.yaml` with configuration for black formatter.
  - Add pre-commit hook to run black on all Python files.
  - Update `pyproject.toml` to include black formatter configuration and add black to the list of dependencies.
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.

1 participant