Spaces:
Sleeping
Sleeping
File size: 1,132 Bytes
47bae79 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | import unittest
import os
from unittest.mock import patch, MagicMock
from agent import (
build_graph,
multiply,
add,
subtract,
divide,
modulus,
power,
square_root,
save_and_read_file,
download_file_from_url,
extract_text_from_image,
analyze_image,
transform_image,
draw_on_image,
generate_simple_image,
combine_images,
analyze_csv_file,
analyze_excel_file,
execute_code_multilang,
web_search,
wiki_search,
arxiv_search,
vector_store,
)
class TestAgent(unittest.TestCase):
def test_multiply(self):
response = multiply.invoke({"a": 6, "b": 7})
self.assertTrue(response["status"])
self.assertEqual(response["data"], 42)
def test_add(self):
response = add.invoke({"a": 5, "b": 3})
self.assertTrue(response["status"])
self.assertEqual(response["data"], 8)
def test_llm(self):
graph = build_graph()
response = graph.invoke({"messages": ["what is 1 + 1"]})
self.assertIsNotNone(response)
print(response)
if __name__ == '__main__':
unittest.main() |