-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
testing enum generation #99
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import unittest | ||
from composio.client.enums import Tag, App, Action, Trigger | ||
|
||
|
||
class TestTagEnum(unittest.TestCase): | ||
def test_tag_enum_values(self): | ||
# Test for specific expected enum values | ||
self.assertEqual(Tag.IMPORTANT.value, ("default", "important")) | ||
self.assertEqual(Tag.ASANA_GOAL_RELATIONSHIPS.value, ("asana", "Goal relationships")) | ||
self.assertEqual(Tag.ATTIO_LISTS.value, ("attio", "Lists")) | ||
self.assertEqual(Tag.BREVO_TASKS.value, ("brevo", "Tasks")) | ||
self.assertEqual(Tag.CLICKUP_TASKS.value, ("clickup", "Tasks")) | ||
|
||
def test_tag_enum_name_property(self): | ||
# Test the name property | ||
self.assertEqual(Tag.IMPORTANT.name, "default") | ||
|
||
def test_tag_enum_names(self): | ||
"""Test the names of the Tag enum.""" | ||
self.assertEqual(Tag.IMPORTANT.name, "default") | ||
self.assertEqual(Tag.ASANA_GOAL_RELATIONSHIPS.name, "asana") | ||
self.assertEqual(Tag.ATTIO_LISTS.name, "attio") | ||
self.assertEqual(Tag.BREVO_TASKS.name, "brevo") | ||
self.assertEqual(Tag.CLICKUP_TASKS.name, "clickup") | ||
|
||
def test_tag_enum_contains(self): | ||
"""Test if specific tags are in the enum.""" | ||
self.assertTrue(Tag.IMPORTANT in Tag) | ||
self.assertTrue(Tag.ASANA_BATCH_API in Tag) | ||
utkarsh-dixit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
self.assertTrue(Tag.BREVO_EMAIL_CAMPAIGNS in Tag) | ||
self.assertTrue(Tag.CLICKUP_USERS in Tag) | ||
|
||
|
||
class TestAppEnum(unittest.TestCase): | ||
def test_app_enum_values(self): | ||
# Test for specific expected enum values | ||
self.assertEqual(App.GITHUB.value, "github") | ||
|
||
def test_app_enum_is_local_property(self): | ||
# Test the is_local property | ||
self.assertFalse(App.GITHUB.is_local) | ||
self.assertTrue(App.LOCALWORKSPACE.is_local) | ||
|
||
|
||
class TestActionEnum(unittest.TestCase): | ||
def test_action_enum_values(self): | ||
# Test for specific expected enum values | ||
self.assertEqual(Action.GITHUB_ACTIONS_GET_SELF_HOSTED_RUNNER_FOR_ORG.value, | ||
("github", "github_actions_get_self_hosted_runner_for_org", False)) | ||
|
||
def test_action_enum_properties(self): | ||
# Test properties | ||
self.assertEqual(Action.GITHUB_ISSUES_LIST.app, "github") | ||
self.assertEqual(Action.GITHUB_ISSUES_LIST.action, "github_issues_list") | ||
self.assertFalse(Action.GITHUB_ISSUES_LIST.no_auth) | ||
|
||
|
||
class TestTriggerEnum(unittest.TestCase): | ||
def test_trigger_enum_values(self): | ||
# Test for specific expected enum values | ||
self.assertEqual(Trigger.SLACK_NEW_MESSAGE.value, ("slack", "slack_receive_message")) | ||
|
||
def test_trigger_enum_properties(self): | ||
# Test properties | ||
self.assertEqual(Trigger.SLACK_THREAD_REPLY.app, "slack") | ||
self.assertEqual(Trigger.SLACK_THREAD_REPLY.event, "slack_receive_thread_reply") | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is a duplicate of the previous assertion for
Tag.IMPORTANT.value
. It should be removed to avoid redundancy.