# Path: lcs/agents/xncs/Effect.py
# class Effect(ImmutableSequence):
# 
#     def __init__(self, observation):
#         super().__init__(observation)
# 
#     def subsumes(self, other) -> bool:
#         for ci, oi in zip(self, other):
#             if ci != self.WILDCARD and oi != self.WILDCARD and ci != oi:
#                 return False
#         return True


import pytest
from lcs.agents.xncs import Effect



class TestEffect:

    def test_init(self):
        ef = Effect("########")
        assert len(ef) == 8
        assert all(item == "#" for item in ef)

    @pytest.mark.parametrize("cond1, cond2, result", [
        ("1111", "1111", True),
        ("11##", "1111", True),
        ("11##", "11##", True),
        ("11", "1111", True),
        ("1111", "10##", False),
    ])
    def test_subsumes(self, cond1, cond2, result):
        assert result == Effect(cond1).subsumes(cond2)

# Path: lcs/agents/xncs/Effect.py
# class Effect(ImmutableSequence):
# 
#     def __init__(self, observation):
#         super().__init__(observation)
# 
#     def subsumes(self, other) -> bool:
#         for ci, oi in zip(self, other):
#             if ci != self.WILDCARD and oi != self.WILDCARD and ci != oi:
#                 return False
#         return True


# Path: tests/lcs/agents/xncs/test_Effect.py
import pytest
from lcs.agents.xncs import Effect




class TestEffect:

    def test_init(self):
        ef = Effect("########")
        assert len(ef) == 8
        assert all(item == "#" for item in ef)

    @pytest.mark.parametrize("cond1, cond2, result", [
        ("1111", "1111", True),
        ("11##", "1111", True),
        ("11##", "11##", True),
        ("11", "1111", True),
        ("1111", "10##", False),
    ])
    def test_subsumes(self, cond1, cond2, result):
        assert result == Effect(cond1).subsumes(cond2)

        assert result == Effect(cond1).subsumes(cond2)