# Path: grappa/operators/none.py
# class NoneOperator(Operator):
#     """
#     Asserts if a given subject is ``None``.
# 
#     Example::
# 
#         # Should style
#         None | should.be.none
# 
#         # Should style - negation form
#         'foo' | should.not_be.none
# 
#         # Expect style
#         None | expect.to.be.none
# 
#         # Expect style - negation form
#         'foo' | expect.to_not.be.none
#     """
# 
#     # Is the operator a keyword
#     kind = Operator.Type.ACCESSOR
# 
#     # Disable diff report
#     show_diff = False
# 
#     # Operator keywords
#     operators = ('none',)
# 
#     # Disable chanined calls
#     chainable = False
# 
#     # Expected message templates
#     expected_message = Operator.Dsl.Message(
#         'a value that is exactly equal to "None"',
#         'a value that is not equal to "None"',
#     )
# 
#     # Subject template message
#     subject_message = Operator.Dsl.Message(
#         'an object with type "{type}" with value "{value}"',
#     )
# 
#     # Assertion information
#     information = (
#         Operator.Dsl.Help(
#             Operator.Dsl.Description(
#                 '"None" is a built-in constant in Python that represents the',
#                 'absence of a value, as when default arguments are not passed',
#                 'to a function. The sole value of the type NoneType.',
#             ),
#             Operator.Dsl.Reference(
#                 'https://docs.python.org/3/library/constants.html#None'
#             ),
#         ),
#     )
# 
#     def match(self, subject):
#         return subject is None, []


import pytest
from grappa.operators.none import NoneOperator
        'foo' | should.not_be.none.to.be.equal(None)

    with pytest.raises(AssertionError):
        False | should.be.none

    with pytest.raises(AssertionError):
        None | should.not_be.none

    with pytest.raises(AssertionError):
        'foo' | should.be.none

    with pytest.raises(AssertionError):
        [1, 2, 3] | should.be.none


def test_expect_none(expect):
    None | expect.to.be.none

    with pytest.raises(AssertionError):
        False | expect.to.be.none

    with pytest.raises(AssertionError):
        'foo' | expect.to.be.none

    with pytest.raises(AssertionError):
        [1, 2, 3] | expect.to.be.none


def test_none_operator(ctx):
    assert NoneOperator(ctx).match(None) == (True, [])

# Path: grappa/operators/none.py
# class NoneOperator(Operator):
#     """
#     Asserts if a given subject is ``None``.
# 
#     Example::
# 
#         # Should style
#         None | should.be.none
# 
#         # Should style - negation form
#         'foo' | should.not_be.none
# 
#         # Expect style
#         None | expect.to.be.none
# 
#         # Expect style - negation form
#         'foo' | expect.to_not.be.none
#     """
# 
#     # Is the operator a keyword
#     kind = Operator.Type.ACCESSOR
# 
#     # Disable diff report
#     show_diff = False
# 
#     # Operator keywords
#     operators = ('none',)
# 
#     # Disable chanined calls
#     chainable = False
# 
#     # Expected message templates
#     expected_message = Operator.Dsl.Message(
#         'a value that is exactly equal to "None"',
#         'a value that is not equal to "None"',
#     )
# 
#     # Subject template message
#     subject_message = Operator.Dsl.Message(
#         'an object with type "{type}" with value "{value}"',
#     )
# 
#     # Assertion information
#     information = (
#         Operator.Dsl.Help(
#             Operator.Dsl.Description(
#                 '"None" is a built-in constant in Python that represents the',
#                 'absence of a value, as when default arguments are not passed',
#                 'to a function. The sole value of the type NoneType.',
#             ),
#             Operator.Dsl.Reference(
#                 'https://docs.python.org/3/library/constants.html#None'
#             ),
#         ),
#     )
# 
#     def match(self, subject):
#         return subject is None, []


# Path: tests/operators/none_test.py
import pytest
from grappa.operators.none import NoneOperator

        'foo' | should.not_be.none.to.be.equal(None)

    with pytest.raises(AssertionError):
        False | should.be.none

    with pytest.raises(AssertionError):
        None | should.not_be.none

    with pytest.raises(AssertionError):
        'foo' | should.be.none

    with pytest.raises(AssertionError):
        [1, 2, 3] | should.be.none


def test_expect_none(expect):
    None | expect.to.be.none

    with pytest.raises(AssertionError):
        False | expect.to.be.none

    with pytest.raises(AssertionError):
        'foo' | expect.to.be.none

    with pytest.raises(AssertionError):
        [1, 2, 3] | expect.to.be.none


def test_none_operator(ctx):
    assert NoneOperator(ctx).match(None) == (True, [])

    assert NoneOperator(ctx).match(1) == (False, [])