Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 4
0
    def test_wrapper_blocks_writes(self):
        m = immutable(mock.Mock())

        with pytest.raises(AttributeError):
            m.something = True
Exemplo n.º 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
Exemplo n.º 6
0
    def test_wrapper_blocks_writes(self):
        m = immutable(mock.Mock())

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