mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-26 00:46:22 +02:00
* Bump setup.py versions for 1.1 * PoC MCP server (#419) * Very initial MCP server PoC for TrustGraph * Put service on port 8000 * Add MCP container and packages to buildout * Update docs for API/CLI changes in 1.0 (#421) * Update some API basics for the 0.23/1.0 API change * Add MCP container push (#425) * Add command args to the MCP server (#426) * Host and port parameters * Added websocket arg * More docs * MCP client support (#427) - MCP client service - Tool request/response schema - API gateway support for mcp-tool - Message translation for tool request & response - Make mcp-tool using configuration service for information about where the MCP services are. * Feature/react call mcp (#428) Key Features - MCP Tool Integration: Added core MCP tool support with ToolClientSpec and ToolClient classes - API Enhancement: New mcp_tool method for flow-specific tool invocation - CLI Tooling: New tg-invoke-mcp-tool command for testing MCP integration - React Agent Enhancement: Fixed and improved multi-tool invocation capabilities - Tool Management: Enhanced CLI for tool configuration and management Changes - Added MCP tool invocation to API with flow-specific integration - Implemented ToolClientSpec and ToolClient for tool call handling - Updated agent-manager-react to invoke MCP tools with configurable types - Enhanced CLI with new commands and improved help text - Added comprehensive documentation for new CLI commands - Improved tool configuration management Testing - Added tg-invoke-mcp-tool CLI command for isolated MCP integration testing - Enhanced agent capability to invoke multiple tools simultaneously * Test suite executed from CI pipeline (#433) * Test strategy & test cases * Unit tests * Integration tests * Extending test coverage (#434) * Contract tests * Testing embeedings * Agent unit tests * Knowledge pipeline tests * Turn on contract tests * Increase storage test coverage (#435) * Fixing storage and adding tests * PR pipeline only runs quick tests * Empty configuration is returned as empty list, previously was not in response (#436) * Update config util to take files as well as command-line text (#437) * Updated CLI invocation and config model for tools and mcp (#438) * Updated CLI invocation and config model for tools and mcp * CLI anomalies * Tweaked the MCP tool implementation for new model * Update agent implementation to match the new model * Fix agent tools, now all tested * Fixed integration tests * Fix MCP delete tool params * Update Python deps to 1.2 * Update to enable knowledge extraction using the agent framework (#439) * Implement KG extraction agent (kg-extract-agent) * Using ReAct framework (agent-manager-react) * ReAct manager had an issue when emitting JSON, which conflicts which ReAct manager's own JSON messages, so refactored ReAct manager to use traditional ReAct messages, non-JSON structure. * Minor refactor to take the prompt template client out of prompt-template so it can be more readily used by other modules. kg-extract-agent uses this framework. * Migrate from setup.py to pyproject.toml (#440) * Converted setup.py to pyproject.toml * Modern package infrastructure as recommended by py docs * Install missing build deps (#441) * Install missing build deps (#442) * Implement logging strategy (#444) * Logging strategy and convert all prints() to logging invocations * Fix/startup failure (#445) * Fix loggin startup problems * Fix logging startup problems (#446) * Fix logging startup problems (#447) * Fixed Mistral OCR to use current API (#448) * Fixed Mistral OCR to use current API * Added PDF decoder tests * Fix Mistral OCR ident to be standard pdf-decoder (#450) * Fix Mistral OCR ident to be standard pdf-decoder * Correct test * Schema structure refactor (#451) * Write schema refactor spec * Implemented schema refactor spec * Structure data mvp (#452) * Structured data tech spec * Architecture principles * New schemas * Updated schemas and specs * Object extractor * Add .coveragerc * New tests * Cassandra object storage * Trying to object extraction working, issues exist * Validate librarian collection (#453) * Fix token chunker, broken API invocation (#454) * Fix token chunker, broken API invocation (#455) * Knowledge load utility CLI (#456) * Knowledge loader * More tests
539 lines
No EOL
20 KiB
Python
539 lines
No EOL
20 KiB
Python
"""
|
|
Tests for Cassandra triples query service
|
|
"""
|
|
|
|
import pytest
|
|
from unittest.mock import MagicMock, patch
|
|
|
|
from trustgraph.query.triples.cassandra.service import Processor
|
|
from trustgraph.schema import Value
|
|
|
|
|
|
class TestCassandraQueryProcessor:
|
|
"""Test cases for Cassandra query processor"""
|
|
|
|
@pytest.fixture
|
|
def processor(self):
|
|
"""Create a processor instance for testing"""
|
|
return Processor(
|
|
taskgroup=MagicMock(),
|
|
id='test-cassandra-query',
|
|
graph_host='localhost'
|
|
)
|
|
|
|
def test_create_value_with_http_uri(self, processor):
|
|
"""Test create_value with HTTP URI"""
|
|
result = processor.create_value("http://example.com/resource")
|
|
|
|
assert isinstance(result, Value)
|
|
assert result.value == "http://example.com/resource"
|
|
assert result.is_uri is True
|
|
|
|
def test_create_value_with_https_uri(self, processor):
|
|
"""Test create_value with HTTPS URI"""
|
|
result = processor.create_value("https://example.com/resource")
|
|
|
|
assert isinstance(result, Value)
|
|
assert result.value == "https://example.com/resource"
|
|
assert result.is_uri is True
|
|
|
|
def test_create_value_with_literal(self, processor):
|
|
"""Test create_value with literal value"""
|
|
result = processor.create_value("just a literal string")
|
|
|
|
assert isinstance(result, Value)
|
|
assert result.value == "just a literal string"
|
|
assert result.is_uri is False
|
|
|
|
def test_create_value_with_empty_string(self, processor):
|
|
"""Test create_value with empty string"""
|
|
result = processor.create_value("")
|
|
|
|
assert isinstance(result, Value)
|
|
assert result.value == ""
|
|
assert result.is_uri is False
|
|
|
|
def test_create_value_with_partial_uri(self, processor):
|
|
"""Test create_value with string that looks like URI but isn't complete"""
|
|
result = processor.create_value("http")
|
|
|
|
assert isinstance(result, Value)
|
|
assert result.value == "http"
|
|
assert result.is_uri is False
|
|
|
|
def test_create_value_with_ftp_uri(self, processor):
|
|
"""Test create_value with FTP URI (should not be detected as URI)"""
|
|
result = processor.create_value("ftp://example.com/file")
|
|
|
|
assert isinstance(result, Value)
|
|
assert result.value == "ftp://example.com/file"
|
|
assert result.is_uri is False
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_spo_query(self, mock_trustgraph):
|
|
"""Test querying triples with subject, predicate, and object specified"""
|
|
from trustgraph.schema import TriplesQueryRequest, Value
|
|
|
|
# Setup mock TrustGraph
|
|
mock_tg_instance = MagicMock()
|
|
mock_trustgraph.return_value = mock_tg_instance
|
|
mock_tg_instance.get_spo.return_value = None # SPO query returns None if found
|
|
|
|
processor = Processor(
|
|
taskgroup=MagicMock(),
|
|
id='test-cassandra-query',
|
|
graph_host='localhost'
|
|
)
|
|
|
|
# Create query request with all SPO values
|
|
query = TriplesQueryRequest(
|
|
user='test_user',
|
|
collection='test_collection',
|
|
s=Value(value='test_subject', is_uri=False),
|
|
p=Value(value='test_predicate', is_uri=False),
|
|
o=Value(value='test_object', is_uri=False),
|
|
limit=100
|
|
)
|
|
|
|
result = await processor.query_triples(query)
|
|
|
|
# Verify TrustGraph was created with correct parameters
|
|
mock_trustgraph.assert_called_once_with(
|
|
hosts=['localhost'],
|
|
keyspace='test_user',
|
|
table='test_collection'
|
|
)
|
|
|
|
# Verify get_spo was called with correct parameters
|
|
mock_tg_instance.get_spo.assert_called_once_with(
|
|
'test_subject', 'test_predicate', 'test_object', limit=100
|
|
)
|
|
|
|
# Verify result contains the queried triple
|
|
assert len(result) == 1
|
|
assert result[0].s.value == 'test_subject'
|
|
assert result[0].p.value == 'test_predicate'
|
|
assert result[0].o.value == 'test_object'
|
|
|
|
def test_processor_initialization_with_defaults(self):
|
|
"""Test processor initialization with default parameters"""
|
|
taskgroup_mock = MagicMock()
|
|
|
|
processor = Processor(taskgroup=taskgroup_mock)
|
|
|
|
assert processor.graph_host == ['localhost']
|
|
assert processor.username is None
|
|
assert processor.password is None
|
|
assert processor.table is None
|
|
|
|
def test_processor_initialization_with_custom_params(self):
|
|
"""Test processor initialization with custom parameters"""
|
|
taskgroup_mock = MagicMock()
|
|
|
|
processor = Processor(
|
|
taskgroup=taskgroup_mock,
|
|
graph_host='cassandra.example.com',
|
|
graph_username='queryuser',
|
|
graph_password='querypass'
|
|
)
|
|
|
|
assert processor.graph_host == ['cassandra.example.com']
|
|
assert processor.username == 'queryuser'
|
|
assert processor.password == 'querypass'
|
|
assert processor.table is None
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_sp_pattern(self, mock_trustgraph):
|
|
"""Test SP query pattern (subject and predicate, no object)"""
|
|
from trustgraph.schema import TriplesQueryRequest, Value
|
|
|
|
# Setup mock TrustGraph and response
|
|
mock_tg_instance = MagicMock()
|
|
mock_trustgraph.return_value = mock_tg_instance
|
|
|
|
mock_result = MagicMock()
|
|
mock_result.o = 'result_object'
|
|
mock_tg_instance.get_sp.return_value = [mock_result]
|
|
|
|
processor = Processor(taskgroup=MagicMock())
|
|
|
|
query = TriplesQueryRequest(
|
|
user='test_user',
|
|
collection='test_collection',
|
|
s=Value(value='test_subject', is_uri=False),
|
|
p=Value(value='test_predicate', is_uri=False),
|
|
o=None,
|
|
limit=50
|
|
)
|
|
|
|
result = await processor.query_triples(query)
|
|
|
|
mock_tg_instance.get_sp.assert_called_once_with('test_subject', 'test_predicate', limit=50)
|
|
assert len(result) == 1
|
|
assert result[0].s.value == 'test_subject'
|
|
assert result[0].p.value == 'test_predicate'
|
|
assert result[0].o.value == 'result_object'
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_s_pattern(self, mock_trustgraph):
|
|
"""Test S query pattern (subject only)"""
|
|
from trustgraph.schema import TriplesQueryRequest, Value
|
|
|
|
mock_tg_instance = MagicMock()
|
|
mock_trustgraph.return_value = mock_tg_instance
|
|
|
|
mock_result = MagicMock()
|
|
mock_result.p = 'result_predicate'
|
|
mock_result.o = 'result_object'
|
|
mock_tg_instance.get_s.return_value = [mock_result]
|
|
|
|
processor = Processor(taskgroup=MagicMock())
|
|
|
|
query = TriplesQueryRequest(
|
|
user='test_user',
|
|
collection='test_collection',
|
|
s=Value(value='test_subject', is_uri=False),
|
|
p=None,
|
|
o=None,
|
|
limit=25
|
|
)
|
|
|
|
result = await processor.query_triples(query)
|
|
|
|
mock_tg_instance.get_s.assert_called_once_with('test_subject', limit=25)
|
|
assert len(result) == 1
|
|
assert result[0].s.value == 'test_subject'
|
|
assert result[0].p.value == 'result_predicate'
|
|
assert result[0].o.value == 'result_object'
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_p_pattern(self, mock_trustgraph):
|
|
"""Test P query pattern (predicate only)"""
|
|
from trustgraph.schema import TriplesQueryRequest, Value
|
|
|
|
mock_tg_instance = MagicMock()
|
|
mock_trustgraph.return_value = mock_tg_instance
|
|
|
|
mock_result = MagicMock()
|
|
mock_result.s = 'result_subject'
|
|
mock_result.o = 'result_object'
|
|
mock_tg_instance.get_p.return_value = [mock_result]
|
|
|
|
processor = Processor(taskgroup=MagicMock())
|
|
|
|
query = TriplesQueryRequest(
|
|
user='test_user',
|
|
collection='test_collection',
|
|
s=None,
|
|
p=Value(value='test_predicate', is_uri=False),
|
|
o=None,
|
|
limit=10
|
|
)
|
|
|
|
result = await processor.query_triples(query)
|
|
|
|
mock_tg_instance.get_p.assert_called_once_with('test_predicate', limit=10)
|
|
assert len(result) == 1
|
|
assert result[0].s.value == 'result_subject'
|
|
assert result[0].p.value == 'test_predicate'
|
|
assert result[0].o.value == 'result_object'
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_o_pattern(self, mock_trustgraph):
|
|
"""Test O query pattern (object only)"""
|
|
from trustgraph.schema import TriplesQueryRequest, Value
|
|
|
|
mock_tg_instance = MagicMock()
|
|
mock_trustgraph.return_value = mock_tg_instance
|
|
|
|
mock_result = MagicMock()
|
|
mock_result.s = 'result_subject'
|
|
mock_result.p = 'result_predicate'
|
|
mock_tg_instance.get_o.return_value = [mock_result]
|
|
|
|
processor = Processor(taskgroup=MagicMock())
|
|
|
|
query = TriplesQueryRequest(
|
|
user='test_user',
|
|
collection='test_collection',
|
|
s=None,
|
|
p=None,
|
|
o=Value(value='test_object', is_uri=False),
|
|
limit=75
|
|
)
|
|
|
|
result = await processor.query_triples(query)
|
|
|
|
mock_tg_instance.get_o.assert_called_once_with('test_object', limit=75)
|
|
assert len(result) == 1
|
|
assert result[0].s.value == 'result_subject'
|
|
assert result[0].p.value == 'result_predicate'
|
|
assert result[0].o.value == 'test_object'
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_get_all_pattern(self, mock_trustgraph):
|
|
"""Test query pattern with no constraints (get all)"""
|
|
from trustgraph.schema import TriplesQueryRequest
|
|
|
|
mock_tg_instance = MagicMock()
|
|
mock_trustgraph.return_value = mock_tg_instance
|
|
|
|
mock_result = MagicMock()
|
|
mock_result.s = 'all_subject'
|
|
mock_result.p = 'all_predicate'
|
|
mock_result.o = 'all_object'
|
|
mock_tg_instance.get_all.return_value = [mock_result]
|
|
|
|
processor = Processor(taskgroup=MagicMock())
|
|
|
|
query = TriplesQueryRequest(
|
|
user='test_user',
|
|
collection='test_collection',
|
|
s=None,
|
|
p=None,
|
|
o=None,
|
|
limit=1000
|
|
)
|
|
|
|
result = await processor.query_triples(query)
|
|
|
|
mock_tg_instance.get_all.assert_called_once_with(limit=1000)
|
|
assert len(result) == 1
|
|
assert result[0].s.value == 'all_subject'
|
|
assert result[0].p.value == 'all_predicate'
|
|
assert result[0].o.value == 'all_object'
|
|
|
|
def test_add_args_method(self):
|
|
"""Test that add_args properly configures argument parser"""
|
|
from argparse import ArgumentParser
|
|
|
|
parser = ArgumentParser()
|
|
|
|
# Mock the parent class add_args method
|
|
with patch('trustgraph.query.triples.cassandra.service.TriplesQueryService.add_args') as mock_parent_add_args:
|
|
Processor.add_args(parser)
|
|
|
|
# Verify parent add_args was called
|
|
mock_parent_add_args.assert_called_once_with(parser)
|
|
|
|
# Verify our specific arguments were added
|
|
args = parser.parse_args([])
|
|
|
|
assert hasattr(args, 'graph_host')
|
|
assert args.graph_host == 'localhost'
|
|
assert hasattr(args, 'graph_username')
|
|
assert args.graph_username is None
|
|
assert hasattr(args, 'graph_password')
|
|
assert args.graph_password is None
|
|
|
|
def test_add_args_with_custom_values(self):
|
|
"""Test add_args with custom command line values"""
|
|
from argparse import ArgumentParser
|
|
|
|
parser = ArgumentParser()
|
|
|
|
with patch('trustgraph.query.triples.cassandra.service.TriplesQueryService.add_args'):
|
|
Processor.add_args(parser)
|
|
|
|
# Test parsing with custom values
|
|
args = parser.parse_args([
|
|
'--graph-host', 'query.cassandra.com',
|
|
'--graph-username', 'queryuser',
|
|
'--graph-password', 'querypass'
|
|
])
|
|
|
|
assert args.graph_host == 'query.cassandra.com'
|
|
assert args.graph_username == 'queryuser'
|
|
assert args.graph_password == 'querypass'
|
|
|
|
def test_add_args_short_form(self):
|
|
"""Test add_args with short form arguments"""
|
|
from argparse import ArgumentParser
|
|
|
|
parser = ArgumentParser()
|
|
|
|
with patch('trustgraph.query.triples.cassandra.service.TriplesQueryService.add_args'):
|
|
Processor.add_args(parser)
|
|
|
|
# Test parsing with short form
|
|
args = parser.parse_args(['-g', 'short.query.com'])
|
|
|
|
assert args.graph_host == 'short.query.com'
|
|
|
|
@patch('trustgraph.query.triples.cassandra.service.Processor.launch')
|
|
def test_run_function(self, mock_launch):
|
|
"""Test the run function calls Processor.launch with correct parameters"""
|
|
from trustgraph.query.triples.cassandra.service import run, default_ident
|
|
|
|
run()
|
|
|
|
mock_launch.assert_called_once_with(default_ident, '\nTriples query service. Input is a (s, p, o) triple, some values may be\nnull. Output is a list of triples.\n')
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_with_authentication(self, mock_trustgraph):
|
|
"""Test querying with username and password authentication"""
|
|
from trustgraph.schema import TriplesQueryRequest, Value
|
|
|
|
mock_tg_instance = MagicMock()
|
|
mock_trustgraph.return_value = mock_tg_instance
|
|
mock_tg_instance.get_spo.return_value = None
|
|
|
|
processor = Processor(
|
|
taskgroup=MagicMock(),
|
|
graph_username='authuser',
|
|
graph_password='authpass'
|
|
)
|
|
|
|
query = TriplesQueryRequest(
|
|
user='test_user',
|
|
collection='test_collection',
|
|
s=Value(value='test_subject', is_uri=False),
|
|
p=Value(value='test_predicate', is_uri=False),
|
|
o=Value(value='test_object', is_uri=False),
|
|
limit=100
|
|
)
|
|
|
|
await processor.query_triples(query)
|
|
|
|
# Verify TrustGraph was created with authentication
|
|
mock_trustgraph.assert_called_once_with(
|
|
hosts=['localhost'],
|
|
keyspace='test_user',
|
|
table='test_collection',
|
|
username='authuser',
|
|
password='authpass'
|
|
)
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_table_reuse(self, mock_trustgraph):
|
|
"""Test that TrustGraph is reused for same table"""
|
|
from trustgraph.schema import TriplesQueryRequest, Value
|
|
|
|
mock_tg_instance = MagicMock()
|
|
mock_trustgraph.return_value = mock_tg_instance
|
|
mock_tg_instance.get_spo.return_value = None
|
|
|
|
processor = Processor(taskgroup=MagicMock())
|
|
|
|
query = TriplesQueryRequest(
|
|
user='test_user',
|
|
collection='test_collection',
|
|
s=Value(value='test_subject', is_uri=False),
|
|
p=Value(value='test_predicate', is_uri=False),
|
|
o=Value(value='test_object', is_uri=False),
|
|
limit=100
|
|
)
|
|
|
|
# First query should create TrustGraph
|
|
await processor.query_triples(query)
|
|
assert mock_trustgraph.call_count == 1
|
|
|
|
# Second query with same table should reuse TrustGraph
|
|
await processor.query_triples(query)
|
|
assert mock_trustgraph.call_count == 1 # Should not increase
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_table_switching(self, mock_trustgraph):
|
|
"""Test table switching creates new TrustGraph"""
|
|
from trustgraph.schema import TriplesQueryRequest, Value
|
|
|
|
mock_tg_instance1 = MagicMock()
|
|
mock_tg_instance2 = MagicMock()
|
|
mock_trustgraph.side_effect = [mock_tg_instance1, mock_tg_instance2]
|
|
|
|
processor = Processor(taskgroup=MagicMock())
|
|
|
|
# First query
|
|
query1 = TriplesQueryRequest(
|
|
user='user1',
|
|
collection='collection1',
|
|
s=Value(value='test_subject', is_uri=False),
|
|
p=None,
|
|
o=None,
|
|
limit=100
|
|
)
|
|
|
|
await processor.query_triples(query1)
|
|
assert processor.table == ('user1', 'collection1')
|
|
|
|
# Second query with different table
|
|
query2 = TriplesQueryRequest(
|
|
user='user2',
|
|
collection='collection2',
|
|
s=Value(value='test_subject', is_uri=False),
|
|
p=None,
|
|
o=None,
|
|
limit=100
|
|
)
|
|
|
|
await processor.query_triples(query2)
|
|
assert processor.table == ('user2', 'collection2')
|
|
|
|
# Verify TrustGraph was created twice
|
|
assert mock_trustgraph.call_count == 2
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_exception_handling(self, mock_trustgraph):
|
|
"""Test exception handling during query execution"""
|
|
from trustgraph.schema import TriplesQueryRequest, Value
|
|
|
|
mock_tg_instance = MagicMock()
|
|
mock_trustgraph.return_value = mock_tg_instance
|
|
mock_tg_instance.get_spo.side_effect = Exception("Query failed")
|
|
|
|
processor = Processor(taskgroup=MagicMock())
|
|
|
|
query = TriplesQueryRequest(
|
|
user='test_user',
|
|
collection='test_collection',
|
|
s=Value(value='test_subject', is_uri=False),
|
|
p=Value(value='test_predicate', is_uri=False),
|
|
o=Value(value='test_object', is_uri=False),
|
|
limit=100
|
|
)
|
|
|
|
with pytest.raises(Exception, match="Query failed"):
|
|
await processor.query_triples(query)
|
|
|
|
@pytest.mark.asyncio
|
|
@patch('trustgraph.query.triples.cassandra.service.TrustGraph')
|
|
async def test_query_triples_multiple_results(self, mock_trustgraph):
|
|
"""Test query returning multiple results"""
|
|
from trustgraph.schema import TriplesQueryRequest, Value
|
|
|
|
mock_tg_instance = MagicMock()
|
|
mock_trustgraph.return_value = mock_tg_instance
|
|
|
|
# Mock multiple results
|
|
mock_result1 = MagicMock()
|
|
mock_result1.o = 'object1'
|
|
mock_result2 = MagicMock()
|
|
mock_result2.o = 'object2'
|
|
mock_tg_instance.get_sp.return_value = [mock_result1, mock_result2]
|
|
|
|
processor = Processor(taskgroup=MagicMock())
|
|
|
|
query = TriplesQueryRequest(
|
|
user='test_user',
|
|
collection='test_collection',
|
|
s=Value(value='test_subject', is_uri=False),
|
|
p=Value(value='test_predicate', is_uri=False),
|
|
o=None,
|
|
limit=100
|
|
)
|
|
|
|
result = await processor.query_triples(query)
|
|
|
|
assert len(result) == 2
|
|
assert result[0].o.value == 'object1'
|
|
assert result[1].o.value == 'object2' |