make property deletions evaluate to false for convenience
This commit is contained in:
parent
85a58eefa9
commit
845f937fa3
@ -11,7 +11,8 @@ class PropertyError(Exception):
|
|||||||
|
|
||||||
|
|
||||||
class PropertyDeletion(object):
|
class PropertyDeletion(object):
|
||||||
pass
|
def __bool__(self):
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
# a special object that will be sent in events when a deletion occured
|
# a special object that will be sent in events when a deletion occured
|
||||||
|
8
test/property/test_property_deletion.py
Normal file
8
test/property/test_property_deletion.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from unittest import TestCase
|
||||||
|
from owrx.property import PropertyDeletion
|
||||||
|
|
||||||
|
|
||||||
|
class PropertyDeletionTest(TestCase):
|
||||||
|
def testDeletionEvaluatesToFalse(self):
|
||||||
|
deletion = PropertyDeletion()
|
||||||
|
self.assertFalse(deletion)
|
Loading…
Reference in New Issue
Block a user