/usr/lib/python2.7/dist-packages/traits/tests/test_property_delete.py is in python-traits 4.6.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | """
Unit tests to ensure that we can call reset_traits/delete on a
property trait (regression tests for Github issue #67).
"""
from traits import _py2to3
from traits.api import Any, HasTraits, Int, Property, TraitError
from traits.testing.unittest_tools import unittest
class E(HasTraits):
a = Property(Any)
b = Property(Int)
class TestPropertyDelete(unittest.TestCase):
def test_property_delete(self):
e = E()
with self.assertRaises(TraitError):
del e.a
with self.assertRaises(TraitError):
del e.b
def test_property_reset_traits(self):
e = E()
unresetable = e.reset_traits()
_py2to3.assertCountEqual(self, unresetable, ['a', 'b'])
|