mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-01-02 06:40:14 +01:00
add a test that makes sure that writing to a filtered property fails
This commit is contained in:
parent
862a251295
commit
8b52988dcd
|
|
@ -11,7 +11,7 @@ class PropertyFilterTest(TestCase):
|
|||
pf = PropertyFilter(pm, "testkey")
|
||||
self.assertEqual(pf["testkey"], "testvalue")
|
||||
|
||||
def testMissesPropert(self):
|
||||
def testMissesProperty(self):
|
||||
pm = PropertyLayer()
|
||||
pm["testkey"] = "testvalue"
|
||||
pf = PropertyFilter(pm, "other_key")
|
||||
|
|
@ -49,3 +49,11 @@ class PropertyFilterTest(TestCase):
|
|||
pf["testkey"] = "new value"
|
||||
self.assertEqual(pm["testkey"], "new value")
|
||||
self.assertEqual(pf["testkey"], "new value")
|
||||
|
||||
def testRejectsWrite(self):
|
||||
pm = PropertyLayer()
|
||||
pm["testkey"] = "old value"
|
||||
pf = PropertyFilter(pm, "otherkey")
|
||||
with self.assertRaises(KeyError):
|
||||
pf["testkey"] = "new value"
|
||||
self.assertEqual(pm["testkey"], "old value")
|
||||
|
|
|
|||
Loading…
Reference in a new issue