commit a4b9ad573f5a4e07b47bf3250682712b6917b0c8 Author: Damian Johnson atagar@torproject.org Date: Sun Feb 2 12:02:52 2020 -0800
Drop ConfChangedEvent's config attribute
A simple string-to-string hash could not convey multi-value configuration values so we replaced it. --- stem/response/events.py | 8 -------- test/unit/response/events.py | 11 ----------- 2 files changed, 19 deletions(-)
diff --git a/stem/response/events.py b/stem/response/events.py index 3f43cfbd..eb8565a6 100644 --- a/stem/response/events.py +++ b/stem/response/events.py @@ -500,11 +500,6 @@ class ConfChangedEvent(Event):
The CONF_CHANGED event was introduced in tor version 0.2.3.3-alpha.
- .. deprecated:: 1.7.0 - Deprecated the *config* attribute. Some tor configuration options (like - ExitPolicy) can have multiple values, so a simple 'str => str' mapping - meant that we only provided the last. - .. versionchanged:: 1.7.0 Added the changed and unset attributes.
@@ -519,7 +514,6 @@ class ConfChangedEvent(Event): def _parse(self): self.changed = {} self.unset = [] - self.config = {} # TODO: remove in stem 2.0
# Skip first and last line since they're the header and footer. For # instance... @@ -538,8 +532,6 @@ class ConfChangedEvent(Event): key, value = line, None self.unset.append(key)
- self.config[key] = value -
class DescChangedEvent(Event): """ diff --git a/test/unit/response/events.py b/test/unit/response/events.py index 46503287..8a93d322 100644 --- a/test/unit/response/events.py +++ b/test/unit/response/events.py @@ -862,12 +862,6 @@ class TestEvents(unittest.TestCase):
self.assertEqual(['ExitPolicy'], event.unset)
- self.assertEqual({ - 'ExitNodes': 'caerSidi', - 'MaxCircuitDirtiness': '20', - 'ExitPolicy': None, - }, event.config) - event = _get_event(CONF_CHANGED_EVENT_MULTIPLE) self.assertTrue(isinstance(event, stem.response.events.ConfChangedEvent))
@@ -878,11 +872,6 @@ class TestEvents(unittest.TestCase):
self.assertEqual([], event.unset)
- self.assertEqual({ - 'ExitPolicy': 'accept 3.4.53.3', # overwrote with second value - 'MaxCircuitDirtiness': '20', - }, event.config) - def test_descchanged_event(self): # all we can check for is that the event is properly parsed as a # DescChangedEvent instance
tor-commits@lists.torproject.org