arcade-mcp/toolkits/math/tests/test_arithmetic.py
Eric Gustin 43198a3a9b
Add New Gmail Tools To The Google Toolkit (#41)
# PR Description

## Summary

Changes include renaming the `arcade_gmail` toolkit to `arcade_google`,
adding unit tests for Google toolkit, add new tools to the Google
toolkit.
## Changes

### Makefile
- Added a new `make test-toolkits` target to iterate over all toolkits
and run pytest on each one.

### Added new tools for the google toolkit

1. `send_email`
This tool sends an email using the Gmail API.

2. `write_draft_email`
This tool creates a draft email using the Gmail API. 

3. `update_draft_email`
This tool updates an existing draft email using the Gmail API.

4. `send_draft_email`
This tool sends a draft email using the Gmail API.

5. `delete_draft_email`
This tool deletes a draft email using the Gmail API. 

6. `list_draft_emails`
This tool retrieves a list of draft emails using the Gmail API.

7. `list_emails_by_header`
This tool searches for emails by a specific header using the Gmail API.
- `sender`: The sender's email address to search for.
- `limit`: The maximum number of emails to retrieve.

8. `list_emails`
This tool retrieves a list of emails using the Gmail API.

9. `trash_email`
This tool moves an email to the trash using the Gmail API.
2024-09-19 10:18:49 -07:00

48 lines
848 B
Python

import pytest
from arcade_arithmetic.tools.arithmetic import (
add,
subtract,
multiply,
divide,
sqrt,
sum_list,
sum_range,
)
def test_add():
assert add(1, 2) == 3
assert add(-1, 1) == 0
assert add(0.5, 10.9) == 11.4
def test_subtract():
assert subtract(2, 1) == 1
assert subtract(2, 3.5) == -1.5
def test_multiply():
assert multiply(2, 3) == 6
assert multiply(-1, 1.5) == -1.5
def test_divide():
assert divide(6, 3) == 2.0
assert divide(5, 2) == 2.5
with pytest.raises(ZeroDivisionError):
divide(1, 0)
def test_sqrt():
assert sqrt(4) == 2.0
assert sqrt(9) == 3.0
def test_sum_list():
assert sum_list([1, 2, 3]) == 6
assert sum_list([0, -1.5, 1]) == -0.5
def test_sum_range():
assert sum_range(1, 3) == 6
assert sum_range(0, 10) == 55