# Path: tt/definitions/operators.py
# BINARY_OPERATORS = {
#     TT_AND_OP,
#     TT_IMPL_OP,
#     TT_NAND_OP,
#     TT_NOR_OP,
#     TT_OR_OP,
#     TT_XNOR_OP,
#     TT_XOR_OP
# }
# 
# Path: tt/tests/unit/trees/_helpers.py
# class ExpressionTreeAndNodeTestCase(unittest.TestCase):
# 
#     def get_tree_root_from_expr_str(self, expr_str):
#         """Get an tree root node from an expression string."""
#         return BooleanExpression(expr_str).tree


from tt.definitions import BINARY_OPERATORS
from ._helpers import ExpressionTreeAndNodeTestCase
"""Test node transformation to condense negations."""




class TestNodeToPrimitives(ExpressionTreeAndNodeTestCase):

    def test_non_negated_operand(self):
        """Test that no change occurs for a non-negated operand."""
        root = self.get_tree_root_from_expr_str('A')
        coalesced = root.coalesce_negations()
        self.assertTrue(coalesced is not root)
        self.assertEqual(
            str(coalesced),
            'A')

    def test_no_change_to_binary_operators(self):
        """Test that no change occurs for any binary operators."""

# Path: tt/definitions/operators.py
# BINARY_OPERATORS = {
#     TT_AND_OP,
#     TT_IMPL_OP,
#     TT_NAND_OP,
#     TT_NOR_OP,
#     TT_OR_OP,
#     TT_XNOR_OP,
#     TT_XOR_OP
# }
# 
# Path: tt/tests/unit/trees/_helpers.py
# class ExpressionTreeAndNodeTestCase(unittest.TestCase):
# 
#     def get_tree_root_from_expr_str(self, expr_str):
#         """Get an tree root node from an expression string."""
#         return BooleanExpression(expr_str).tree


# Path: tt/tests/unit/trees/test_node_coalesce_negations.py
from tt.definitions import BINARY_OPERATORS
from ._helpers import ExpressionTreeAndNodeTestCase

"""Test node transformation to condense negations."""




class TestNodeToPrimitives(ExpressionTreeAndNodeTestCase):

    def test_non_negated_operand(self):
        """Test that no change occurs for a non-negated operand."""
        root = self.get_tree_root_from_expr_str('A')
        coalesced = root.coalesce_negations()
        self.assertTrue(coalesced is not root)
        self.assertEqual(
            str(coalesced),
            'A')

    def test_no_change_to_binary_operators(self):
        """Test that no change occurs for any binary operators."""

        for op in BINARY_OPERATORS: