From 4ea1de7a1fda25e5c3079f03b71a10d5096c89fd Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Thu, 4 Sep 2025 00:31:48 +0100 Subject: [PATCH] Fix tests --- .../test_cassandra_config_end_to_end.py | 16 ++++++++-------- .../test_objects_cassandra_integration.py | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/integration/test_cassandra_config_end_to_end.py b/tests/integration/test_cassandra_config_end_to_end.py index 17a59706..a2d30e85 100644 --- a/tests/integration/test_cassandra_config_end_to_end.py +++ b/tests/integration/test_cassandra_config_end_to_end.py @@ -218,19 +218,19 @@ class TestConfigurationPriorityEndToEnd: assert 'auth_provider' not in call_args.kwargs # No auth with default config -class TestBackwardCompatibilityEndToEnd: - """Test backward compatibility with old parameter names end-to-end.""" +class TestNoBackwardCompatibilityEndToEnd: + """Test that backward compatibility with old parameter names is removed.""" @pytest.mark.asyncio @patch('trustgraph.direct.cassandra.Cluster') - async def test_old_graph_params_still_work_end_to_end(self, mock_cluster): - """Test that old graph_* parameters still work end-to-end.""" + async def test_old_graph_params_no_longer_work_end_to_end(self, mock_cluster): + """Test that old graph_* parameters no longer work end-to-end.""" mock_cluster_instance = MagicMock() mock_session = MagicMock() mock_cluster_instance.connect.return_value = mock_session mock_cluster.return_value = mock_cluster_instance - # Use old parameter names + # Use old parameter names (should be ignored) processor = TriplesWriter( taskgroup=MagicMock(), graph_host='legacy-host', @@ -246,11 +246,11 @@ class TestBackwardCompatibilityEndToEnd: await processor.store_triples(mock_message) - # Should work with legacy parameters + # Should use defaults since old parameters are not recognized mock_cluster.assert_called_once() call_args = mock_cluster.call_args - assert call_args.args[0] == ['legacy-host'] - assert 'auth_provider' in call_args.kwargs # Should have auth since credentials provided + assert call_args.args[0] == ['cassandra'] # Default, not legacy-host + assert 'auth_provider' not in call_args.kwargs # No auth since no valid credentials @patch('trustgraph.storage.knowledge.store.KnowledgeTableStore') def test_old_cassandra_user_param_still_works_end_to_end(self, mock_table_store): diff --git a/tests/integration/test_objects_cassandra_integration.py b/tests/integration/test_objects_cassandra_integration.py index a54384f5..ff161d04 100644 --- a/tests/integration/test_objects_cassandra_integration.py +++ b/tests/integration/test_objects_cassandra_integration.py @@ -294,8 +294,8 @@ class TestObjectsCassandraIntegration: async def test_authentication_handling(self, processor_with_mocks): """Test Cassandra authentication""" processor, mock_cluster, mock_session = processor_with_mocks - processor.graph_username = "cassandra_user" - processor.graph_password = "cassandra_pass" + processor.cassandra_username = "cassandra_user" + processor.cassandra_password = "cassandra_pass" with patch('trustgraph.storage.objects.cassandra.write.Cluster') as mock_cluster_class: with patch('trustgraph.storage.objects.cassandra.write.PlainTextAuthProvider') as mock_auth: