send property changes in bulk to global subscribers

This commit is contained in:
Jakob Ketterl
2020-12-30 17:14:06 +01:00
parent eb34c45145
commit 2c3146314b
4 changed files with 32 additions and 31 deletions

View File

@ -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")
@ -25,7 +25,7 @@ class PropertyFilterTest(TestCase):
mock = Mock()
pf.wire(mock.method)
pm["testkey"] = "testvalue"
mock.method.assert_called_once_with("testkey", "testvalue")
mock.method.assert_called_once_with({"testkey": "testvalue"})
def testForwardsPropertyEvent(self):
pm = PropertyLayer()

View File

@ -19,7 +19,7 @@ class PropertyLayerTest(TestCase):
mock = Mock()
pm.wire(mock.method)
pm["testkey"] = "after"
mock.method.assert_called_once_with("testkey", "after")
mock.method.assert_called_once_with({"testkey": "after"})
def testUnsubscribe(self):
pm = PropertyLayer()
@ -27,7 +27,7 @@ class PropertyLayerTest(TestCase):
mock = Mock()
sub = pm.wire(mock.method)
pm["testkey"] = "between"
mock.method.assert_called_once_with("testkey", "between")
mock.method.assert_called_once_with({"testkey": "between"})
mock.reset_mock()
pm.unwire(sub)

View File

@ -49,7 +49,7 @@ class PropertyStackTest(TestCase):
mock = Mock()
stack.wire(mock.method)
layer["testkey"] = "testvalue"
mock.method.assert_called_once_with("testkey", "testvalue")
mock.method.assert_called_once_with({"testkey": "testvalue"})
def testPropertyChangeEventPriority(self):
low_layer = PropertyLayer()
@ -64,7 +64,7 @@ class PropertyStackTest(TestCase):
low_layer["testkey"] = "modified low value"
mock.method.assert_not_called()
high_layer["testkey"] = "modified high value"
mock.method.assert_called_once_with("testkey", "modified high value")
mock.method.assert_called_once_with({"testkey": "modified high value"})
def testPropertyEventOnLayerAdd(self):
low_layer = PropertyLayer()
@ -162,7 +162,7 @@ class PropertyStackTest(TestCase):
mock = Mock()
stack.wire(mock.method)
stack.removeLayer(layer)
mock.method.assert_called_once_with("testkey", None)
mock.method.assert_called_once_with({"testkey": None})
mock.reset_mock()
layer["testkey"] = "after"