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
def test_wrapper_is_recursive_by_default(self): m = immutable(mock.Mock(anything=mock.Mock())) with pytest.raises(AttributeError): m.anything.something = True
def test_wrapper_blocks_writes(self): m = immutable(mock.Mock()) with pytest.raises(AttributeError): m.something = True