Пример #1
0
    def test_wrapper_can_be_non_recursive(self):
        m = immutable(mock.Mock(), recursive=False)

        with pytest.raises(AttributeError):
            m.anything = True

        m.anything.something = True
Пример #2
0
    def test_wrapper_can_be_non_recursive(self):
        m = immutable(mock.Mock(), recursive=False)

        with pytest.raises(AttributeError):
            m.anything = True

        m.anything.something = True
Пример #3
0
    def test_wrapper_is_recursive_by_default(self):
        m = immutable(mock.Mock(anything=mock.Mock()))

        with pytest.raises(AttributeError):
            m.anything.something = True
Пример #4
0
    def test_wrapper_blocks_writes(self):
        m = immutable(mock.Mock())

        with pytest.raises(AttributeError):
            m.something = True
Пример #5
0
    def test_wrapper_is_recursive_by_default(self):
        m = immutable(mock.Mock(anything=mock.Mock()))

        with pytest.raises(AttributeError):
            m.anything.something = True
Пример #6
0
    def test_wrapper_blocks_writes(self):
        m = immutable(mock.Mock())

        with pytest.raises(AttributeError):
            m.something = True