Skip to content

Commit

Permalink
Fix milvus_memory_test.py mock Config (Significant-Gravitas#3424)
Browse files Browse the repository at this point in the history
Co-authored-by: k-boikov <[email protected]>
  • Loading branch information
Androbin and k-boikov authored May 13, 2023
1 parent 6c78d80 commit 7a34d49
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions tests/milvus_memory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@
import unittest

try:
from autogpt.config import Config
from autogpt.memory.milvus import MilvusMemory

def mock_config() -> dict:
def mock_config() -> Config:
"""Mock the config object for testing purposes."""

# Return a mock config object with the required attributes
return type(
"MockConfig",
(object,),
{
"debug_mode": False,
"continuous_mode": False,
"speak_mode": False,
"milvus_collection": "autogpt",
"milvus_addr": "localhost:19530",
},
)
class MockConfig(Config):
debug_mode = False
continuous_mode = False
speak_mode = False
milvus_collection = "autogpt"
milvus_addr = "localhost:19530"

return MockConfig()

class TestMilvusMemory(unittest.TestCase):
"""Tests for the MilvusMemory class."""
Expand Down

0 comments on commit 7a34d49

Please sign in to comment.