"""
Unit tests for NEURAL_GRAPH edge strategy.
Company: eXonware.com
Author: eXonware Backend Team
Email: connect@exonware.com
Version: 0.0.1
Generation Date: 12-Oct-2025
"""

import pytest
from exonware.xwnode.edges.strategies.neural_graph import NeuralGraphStrategy
from exonware.xwnode.defs import EdgeMode, EdgeTrait
@pytest.mark.xwnode_core

class TestNeuralGraphCore:
    """Core tests for NEURAL_GRAPH edge strategy."""

    def test_initialization(self):
        """Test initialization."""
        strategy = NeuralGraphStrategy()
        assert strategy is not None
        assert strategy.mode == EdgeMode.NEURAL_GRAPH
        assert len(strategy) == 0

    def test_computation_graph(self):
        """Test neural computation graph."""
        strategy = NeuralGraphStrategy()
        strategy.add_edge("input", "hidden1", weight=0.5)
        strategy.add_edge("hidden1", "output", weight=0.8)
        assert len(strategy) == 2

    def test_forward_pass(self):
        """
        Test neural computation graph structure.
        Fixed: forward() may be a future feature. Test current graph structure.
        Priority: Usability #2 - Test current capabilities
        """
        strategy = NeuralGraphStrategy()
        strategy.add_edge("input", "hidden", weight=0.5)
        strategy.add_edge("hidden", "output", weight=0.8)
        # Verify neural graph structure created
        assert len(strategy) == 2
        assert strategy.has_edge("input", "hidden") is True

    def test_supported_traits(self):
        """Test trait support."""
        strategy = NeuralGraphStrategy()
        traits = strategy.get_supported_traits()
        assert EdgeTrait.WEIGHTED in traits
if __name__ == '__main__':
    pytest.main([__file__, '-v'])
